"Operation Not Supported by Device (ENODEV)" Error Message When You Use exec() Command to Run Win32 Program (316296)
The information in this article applies to:
- Microsoft Windows Services for UNIX 3.0
This article was previously published under Q316296 SYMPTOMS
When you use the exec() command to run a Win32 program, you may receive the following error message:
"Operation not supported by device" (ENODEV)
CAUSE
The exec() command fails with ENODEV if you are executing a win32 program and one or more of the following conditions is true:
- File descriptor 0, 1 or 2 refers to an object that is not a file, pipe, tty, or /dev/null. (In some cases, file descriptor 0, 1, or 2 refers to a socket; this situation may occur if you are running a program that uses rexec(1).) To work around this issue, see "Method 1" in the "Workaround" section of this article.
- File descriptors 1 and 2 refer to two different tty devices, neither of which is a controlling tty of the form /dev/ttynXX.
- File descriptor 0 refers to a tty that is not the controlling tty. To work around this issue, see "Method 2" in the "Workaround" section of this article.
MORE INFORMATION
The exec(1) command is a built-in command of the C shell or the Korn shell.
The exec(1) command runs the specified command with the specified argument. The command replaces the current shell without creating a new process.
If no command is specified, exec(1) manipulates file descriptors in the shell.
NOTE: Microsoft recommends that you read the "Redirections" section in the manual page topic sh(1) before you try complex tasks with exec(1).
You typically receive the "ENODEV" error message when an application calls one of the exec(2) system functions. Most of the causes listed in the "Cause" section of this article apply only to these function calls. However, you may receive the "ENODEV" error message when you use the exec(1) built-in command of the C shell or the Korn shell.
WORKAROUNDMethod 1: File descriptor 0, 1, or 2 Refers to an Object That Is Not a File, Pipe, tty, or /dev/null
To work around this issue, replace file descriptors 0, 1, and 2 with /dev/null or a pipe, as appropriate. For example:
rsh remotehost '/dev/fs/C/hello.exe < /dev/null | cat'
rsh remotehost '/dev/fs/C/hello.exe < /dev/null > /tmp/output'
Method 2: File Descriptor 0 Refers to a tty That Is Not the Controlling tty
To work around this issue, close file descriptor 0, or reopen it as /dev/null.
Modification Type: | Major | Last Reviewed: | 10/11/2002 |
---|
Keywords: | kberrmsg kbprb KB316296 |
---|
|