Why no setuid in linux.d?
Lars T. Kyllingstad
public at kyllingen.NOSPAMnet
Fri Nov 19 03:58:22 PST 2010
On Fri, 19 Nov 2010 12:33:02 +0100, 0ffh wrote:
> I've written a programme that serves port 80, which usually requires
> root access. Therefore, after acquiring the socket I want to relinquish
> root by setting the uid to nonzero. I needed to add "int setuid(uid_t
> uid);" to linux.d and recompile Phobos in order to do so.
> I there a specific reason that setuid (and the related commands setgid,
> getuid, geteuid, getgid and getegid) is/are missing in the standard
> version of linux.d?
All the POSIX headers are in the core.sys.posix package. In your case,
what you need is to import core.sys.posix.unistd.
More information about the Digitalmars-d-learn