병렬포트를 제어를 일반사용자권한으로 할수 없나요??
ioperm() 함수에서 operation not permitted 라는 메세지가 뜹니다.
소스 코드 올리겠습니다. setuid() 함수를 쓰면 된다는데. 아무리 해도 안됩니다.
지금 // 주석 된 부분을 setreuid(500,0),setreuid(0,0),setreuid(0,500) 이렇게
여러가지 경우 해 보아도 안되었습니다.
setuid(0);
if(ioperm(BASE_PORT, 3, 1))
{
perror("ioperm");
exit(1);
}
#include <sys/io.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>