Hi,
I running Bering 1.2.
Now I try to make a tool to show my beringBOX status via /dev/lp0.
I got a examples code
#include <stdio.h>
#include <unistd.h>
#include <asm/io.h>
#define BASEPORT 0x3bc /* lp0 */
int main()
{
/* Get access to the ports */
if (ioperm(BASEPORT, 3, 1)) {perror("ioperm"); exit(1);}
/* Set the data signals (D0-7) of the port to all low (0) */
outb(0, BASEPORT);
/* Sleep for a while (100 ms) */
usleep(100000);
/* Read from the status port (BASE+1) and display the result */
printf("status: %d\n", inb(BASEPORT + 1));
/* We don't need the ports anymore */
if (ioperm(BASEPORT, 3, 0)) {perror("ioperm"); exit(1);}
exit(0);
}
If I run it on my BeringBox I got the message:
gersec: denied use of ioperm() by (myprog:13521) UID(0) EUID(0),
parent (sh:789) UID(0) EUID(0)
ioperm: Operation not permitted
I've try to change the right for lp0 (chmod 777 /dev/lp0)
but it deosn't work :( what can I do else?
I'm deeply greatful for any suggestions
Phuoc
-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
------------------------------------------------------------------------
leaf-user mailing list: [EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/leaf-user
SR FAQ: http://leaf-project.org/pub/doc/docmanager/docid_1891.html