Re: [PATCH v3 14/14] daemon: only use posix features on posix systems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Oct 10, 2010 at 13:20, Erik Faye-Lund <kusmabite@xxxxxxxxx> wrote:
> Windows does not supply the POSIX-functions fork(), setuuid(), setgid(),
> setsid() and initgroups(). Disable support for --user, --group and
> --detach on platforms lacking _POSIX_VERSION.

FWIW I checked if Perl's fork() emulation with threads on Windows
could emulate this, but no:

    perl -E '
    if (my $pid = fork()) {
      say "$$: child running as $pid"
    } else {
      sleep 1;
      say "$$: running in the background"
    }'

On Unix that would detach the process from the terminal, but on
Windows with threads the original process only returns after the child
has finished.

I didn't expect it to act differently, but I thought I'd note it here
in case anyone had it in mind to implement --detach on Windows.

> This might be a bit controversial; does anyone know of any systems that
> implements fork(), setuuid(), setgid() and setsid() but does not define
> _POSIX_VERSION? Perhaps we should have a separate makefile-switch instead?

Even if it's defined it's more self-documenting to have our own
HAVE_POSIX_GOODIES (or something like that) instead.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]