Microsoft KB Archive/316296

= &quot;Operation Not Supported by Device (ENODEV)&quot; Error Message When You Use exec Command to Run Win32 Program =

Article ID: 316296

Article Last Modified on 10/30/2006

-

APPLIES TO


 * Microsoft Windows Services for UNIX 3.0 Standard Edition

-



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:

&quot;Operation not supported by device&quot; (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 &quot;Method 1&quot; in the &quot;Workaround&quot; 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 &quot;Method 2&quot; in the &quot;Workaround&quot; 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 &quot;Redirections&quot; section in the manual page topic sh(1) before you try complex tasks with exec(1).

You typically receive the &quot;ENODEV&quot; error message when an application calls one of the exec(2) system functions. Most of the causes listed in the &quot;Cause&quot; section of this article apply only to these function calls. However, you may receive the &quot;ENODEV&quot; error message when you use the exec(1) built-in command of the C shell or the Korn shell.



Method 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.

Keywords: kberrmsg kbprb KB316296

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.