high_flyer

No, because afaik this is the initialization for the C-library version.
During boot my system do the following (of course as root) :


DEVNAME="ppdrv_device"
depmod
modprobe kparapin
modprobe parapindriver devname=${DEVNAME}
mknod /dev/${DEVNAME} u `grep $DEVNAME /proc/devices | cut -d " " -f 1` 0
# Change mode and ownership here if necessary
chmod 777 /dev/${DEVNAME}
chown root /dev/${DEVNAME}
chgrp root /dev/${DEVNAME}

After this is done i acces the parapellport (as user) by opening the device:

pardevice = open("/dev/ppdrv_device", 0);
if (pardevice < 0) {
fprintf(stderr, "pardevice open failed\n");
exit(-1);

from this point on i can simply acces the parallelport with the ioctl command, e.g.:

ioctl(pardevice, PPDRV_IOC_PINMODE_OUT, LP_PIN02);
ioctl(pardevice, PPDRV_IOC_PINSET, LP_PIN02 | LP_PIN03)

I preferred this because i added some parts to the KSIMUS Application.
Its a Electronics simulator by Rasmus Diekenbrock.
I want to avoid the need of root access during the simulator is accessing
the parallelport. It works perfect in KSIMUS (also the close(device) command
which is the reason i wrote here.

In a simple new Kdevelop project, just for open the device,
setting some pins and close the device, this mini application
doesn't work as expected.

When i call "close(device" all of the widgets ( 3 pushbuttons for open/set/close)
disappear and thats it. I have to kill the process.

I wrote here in QT-Centre because i think its not a problem of parapin.
Parapin works perfect e.g. in the ksimus enveronment.

I am sure i am making some coding or logical errors in my code.
( maybe the close(device) command from unistd.h is not welcome.

Also some hint is desireable how to trace what is going on in the app
after calling close(device) and the "crash"

"gdb" and the system messages do not contain strange infos on this.

cheers wally