Linux - Embedded & Single-board computerThis forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i could make it to a point to switch GPIO Pins on a B-Pi from the command line.
Primarily i want to do this from user code.
I found this http://www.wiki.xilinx.com/GPIO+User+Space+App
telling to use fcntl.h The point is, neigther me nor my compile can find a routine "close(fd)"; I have looked in the fcntl.h directly and in
#include <sys/cdefs.h>
#include <sys/types.h>
#include <linux/fcntl.h>
which are included by the header.
Actually on first try i simply used the fopen and fprintf way, but my programm crashes then...
hm... okay, then the problem is something else.
Looks like in my Qt Envoironment the close() method closes the App.
I need to tell the compiler that i´m refering to the close method from
unistd.h
But i´m wondering how to do that without a namespace...
I tried that, but the program crashes then. Plus the other How-To´s on this are doing it different.
But what annoys me, is that i need root level for writing to the export file. So the App needs to run as root, which is not possible by the programm itself.
Where is the sense in providing a driver but saying me i´m not allowed to use it by default...
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150
Rep:
Quote:
Originally Posted by Jasson
... But what annoys me, is that i need root level for writing to the export file ...
All the stuff in /sys/* is used by the system and indiscriminate writing to it can seriously screw with your system if not completely fubar it, it is perfectly normal to need admin privileges to write to /sys/* otherwise anyone logged on could do pretty much what they want, complain to the author of the article about not making it clear that you would need root access.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.