Skip to content

Commit

Permalink
errno.h: Improve ENOSYS's comment
Browse files Browse the repository at this point in the history
ENOSYS is the mechanism used by user code to detect whether the running
kernel implements a given system call.  It should not be returned by
anything except an unimplemented system call.

Unfortunately, it is rather frequently used in the kernel to indicate that
various new functions of existing system calls are not implemented.  This
should be discouraged.

Improve the comment in errno.h to help clarify ENOSYS's purpose.

Signed-off-by: Andy Lutomirski <[email protected]>
Cc: Pavel Machek <[email protected]>
Cc: Michael Kerrisk <[email protected]>
Cc: Joe Perches <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
amluto authored and torvalds committed Apr 17, 2015
1 parent 91c9afa commit e15f431
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion include/uapi/asm-generic/errno.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,16 @@
#define EDEADLK 35 /* Resource deadlock would occur */
#define ENAMETOOLONG 36 /* File name too long */
#define ENOLCK 37 /* No record locks available */
#define ENOSYS 38 /* Function not implemented */

/*
* This error code is special: arch syscall entry code will return
* -ENOSYS if users try to call a syscall that doesn't exist. To keep
* failures of syscalls that really do exist distinguishable from
* failures due to attempts to use a nonexistent syscall, syscall
* implementations should refrain from returning -ENOSYS.
*/
#define ENOSYS 38 /* Invalid system call number */

#define ENOTEMPTY 39 /* Directory not empty */
#define ELOOP 40 /* Too many symbolic links encountered */
#define EWOULDBLOCK EAGAIN /* Operation would block */
Expand Down

0 comments on commit e15f431

Please sign in to comment.