delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/01/24/02:41:26

From: shankar AT chromatic DOT com (Shankar Unni)
Subject: fork() fails for network-mounted executables
24 Jan 1997 02:41:26 -0800 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <32E83799.340A.cygnus.gnu-win32@chromatic.com>
Mime-Version: 1.0
X-Mailer: Mozilla 3.0Gold (X11; I; SunOS 5.5.1 sun4u)
Original-To: gnu-win32 AT cygnus DOT com
Original-CC: noer AT cygnus DOT com
Original-Sender: owner-gnu-win32 AT cygnus DOT com

Geoffrey, consider this a bug report, which is why I'm also directly
cc'ing you. 

On Windows 95, if an executable calling fork() lives in a
network-mounted directory, the fork() fails with errno = 13 (EACCES -
Permission denied).

Here's a simple example. If you put this executable on a network-mounted
drive, it will fail. If it is on a local drive, it will succeed:

    #include <errno.h>
 
    main(int argc, char **argv)
    {
        int pid;
 
        printf("In %d\n", getpid());
        if (argc == 1) {
            if ((pid = fork()) == 0) {
                /* child */
                execl(argv[0], argv[0], "dummy", 0);
                printf("execl of %s failed\n", argv[0]);
            } else if (pid == -1) {
                printf("fork failed - errno = %d\n", errno);
            } else {
                int *x;
                printf("In parent of %d\n", pid);
                wait(&x);
            }
        }
    }

Is there any workaround for this at all? I've been unable to find any
(even specifying the full path fails).

Thanks,
-- 
Shankar Unni                                  shankar AT chromatic DOT com
Chromatic Research                            (408) 752-9488
-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019