Locking Devices on the SUN IPC
Posted in 1993
HELP!! I,ve tried posting in comp.unix to no avail. Since we are linking this into our 4gl code, I thought I would give this newsgroup a try. We are trying to lock devices on a SUN IPC running under 4.1.3 OS level, and keep getting errors of 2,6, and 13. ( No such file, No such device, permission denied. ). Typing mistakes are out of the question, since we've tried every device in the /dev directory. Here is an example of the code we are trying to use: int lock_fd(fd) int fd; { struct flock lck; lck.l_type = F_WRLCK; lck.l_whence = 0; lck.l_start = 0; lck.l_len = 1; lck.l_pid = getpid(); return ( fcntl( fd, F_SETLK, &lck ) == 0 ); } Somehow error keeps getting set to one of those values indicated above. If anyone can help - Thanks, in advance. -- Robert Minter Data Systems Support Programmer, Software Development Orange, CA internet: rob@dssmktg.com Tel: 714.771.0454 bangpath: uunet.uu.net!dssmktg!rob Fax: 714.771.3028