C - development under UNIX - XENIX
Dennis G. Rears FSAC
drears at ardec.arpa
Sat May 7 04:49:12 AEST 1988
Michael Deutsch <deutsch at jplgodo.uucp> writes:
MD>These are questions for "C" and "UNIX" hackers.
MD>
MD>Your answer to all of these or a few will be greatly appreciated.
MD>
MD>1. A UNIX function call equivalent to: "mkdir" command is???
mkdir(2) is available on some unixes. If it is not available on
yours try mknod(2). You must be root to run this call though.
MD>2. A programm running with "setuid" privilege, i.e.: -rwsr-xr-x
MD> tries to create directory and fails when executed by non-root,
MD> however, it works when executed by root, why???
Is the program set to the right owner?
MD>
MD>3. How to issue an "lp/lpr" command from the program without
MD> diagnostic popping up on the terminal???
Redirect stdin and stderr to /dev/null or some other file.
MD>
MD>4. Which header file or type contains info on the file, i.e. (size,
MD> date created, date modified, number of links, etc.).
MD>
Try /usr/include/sys/stat.h. The system call would be stat(2)
and fstat(2).
I can't help with the other stuff now. I help this helps.
Dennis
--------------------------------------------------------------------------
ARPA: drears at ardec-ac4.arpa UUCP: ...!uunet!ardec-ac4.arpa!drears
AT&T: 201-724-6639 Snailmail: Box 210, Wharton, NJ 07885
Flames: /dev/null Reincarnation: newton!babbage!patton!drears
Work: SMCAR-FSS-E, Dennis Rears, Bldg 94, Picatinny Ars, NJ 07806
--------------------------------------------------------------------------
More information about the Comp.unix.wizards
mailing list