A mirror of Man pages
Go to file
Rik van Riel e52ca1bf3a execve.2: execve also returns E2BIG if a string is too long
The execve syscall returns -E2BIG in 3 cases:
- The total length of the command line arguments and environment is too large.
- An argument or environment string (including the NUL byte) is longer than MAX_ARG_STRLEN.
- The full path to the executable (including the NUL byte) exceeds MAX_ARG_STRLEN.

Spell out all 3 cases in the -E2BIG section.

Discovered by moving a too large commandline parameter to an environment
variable, and finding that things still did not work. Examined the code
in fs/exec.c to get the details.

This simple shell script starts failing at 2^17 on a system with 4kB
page size:
./exec2big.sh: line 10: /bin/true: Argument list too long
fork failed at loop 17

STRING="a"

for loop in `seq 20`; do
	STRING="$STRING$STRING"
	export STRING
	if /bin/true ; then
		: # still under the limit
	else
		echo "fork failed at loop $loop"
	fi
done

Signed-off-by: Rik van Riel <riel@surriel.com>
Suggested-by: Matthew House <mattlloydhouse@gmail.com>
2023-10-11 21:08:12 -04:00
man1 iconv.1, ldd.1, accept.2, access.2, add_key.2, arch_prctl.2, bpf.2, chmod.2, chown.2, close_range.2, copy_file_range.2, execve.2, execveat.2, fanotify_mark.2, futex.2, futimesat.2, getpriority.2, intro.2, ioctl_tty.2, keyctl.2, link.2, membarrier.2, mkdir.2, mknod.2, mlock.2, mount.2, mount_setattr.2, open.2, open_by_handle_at.2, perf_event_open.2, pidfd_open.2, readlink.2, readv.2, rename.2, request_key.2, seccomp.2, sigaction.2, stat.2, statx.2, symlink.2, syscalls.2, umount.2, unlink.2, utimensat.2, wait.2, bsearch.3, fflush.3, getaddrinfo.3, getauxval.3, getopt.3, getsubopt.3, mkfifo.3, pthread_mutex_consistent.3, pthread_setname_np.3, pthread_tryjoin_np.3, scandir.3, sem_wait.3, stailq.3, strlen.3, strstr.3, termios.3, tsearch.3, wcslen.3, wcstok.3, wordexp.3, proc.5, capabilities.7, cgroups.7, fanotify.7, mount_namespaces.7, namespaces.7, path_resolution.7, pipe.7, posixoptions.7, user_namespaces.7, vdso.7, iconvconfig.8, ld.so.8: tstamp 2021-08-27 02:44:07 +02:00
man2 execve.2: execve also returns E2BIG if a string is too long 2023-10-11 21:08:12 -04:00
man3 malloc.3: Clarify that realloc() may move the memory block 2021-08-31 04:02:29 +02:00
man4 console_codes.4: tfix 2021-07-26 01:31:54 +02:00
man5 proc.5: Fixes various references to kernel docs in Documentation/ 2021-08-31 03:06:45 +02:00
man6 intro.6: wfix 2017-08-25 21:41:03 +02:00
man7 mount_namespaces.7: Update references to Documentation/filesystems/sharedsubtree.rst 2021-08-31 03:06:52 +02:00
man8 iconv.1, ldd.1, accept.2, access.2, add_key.2, arch_prctl.2, bpf.2, chmod.2, chown.2, close_range.2, copy_file_range.2, execve.2, execveat.2, fanotify_mark.2, futex.2, futimesat.2, getpriority.2, intro.2, ioctl_tty.2, keyctl.2, link.2, membarrier.2, mkdir.2, mknod.2, mlock.2, mount.2, mount_setattr.2, open.2, open_by_handle_at.2, perf_event_open.2, pidfd_open.2, readlink.2, readv.2, rename.2, request_key.2, seccomp.2, sigaction.2, stat.2, statx.2, symlink.2, syscalls.2, umount.2, unlink.2, utimensat.2, wait.2, bsearch.3, fflush.3, getaddrinfo.3, getauxval.3, getopt.3, getsubopt.3, mkfifo.3, pthread_mutex_consistent.3, pthread_setname_np.3, pthread_tryjoin_np.3, scandir.3, sem_wait.3, stailq.3, strlen.3, strstr.3, termios.3, tsearch.3, wcslen.3, wcstok.3, wordexp.3, proc.5, capabilities.7, cgroups.7, fanotify.7, mount_namespaces.7, namespaces.7, path_resolution.7, pipe.7, posixoptions.7, user_namespaces.7, vdso.7, iconvconfig.8, ld.so.8: tstamp 2021-08-27 02:44:07 +02:00
scripts scripts/bash_aliases: tfix 2021-08-08 01:02:32 +02:00
.gitignore .gitignore: Tweaks to Alex's .gitignore 2021-05-11 04:34:03 +12:00
CONTRIBUTING CONTRIBUTING: New file with some starting tips on how to contribute 2019-09-13 15:59:08 +02:00
Changes Start of man-pages-5.14: updating Changes and Changes.old 2021-08-27 22:13:35 +02:00
Changes.old Changes.old: tfix 2021-08-31 02:30:21 +02:00
MAINTAINER_NOTES MAINTAINER_NOTES: tfix 2021-01-24 23:30:51 +01:00
Makefile Makefile, README: Break installation into a target for each mandir 2021-06-10 10:32:59 +12:00
README Makefile, README: Break installation into a target for each mandir 2021-06-10 10:32:59 +12:00
man-pages-5.14.Announce Start of man-pages-5.14: updating .Announce and .lsm files 2021-08-27 22:13:35 +02:00
man-pages-5.14.lsm Start of man-pages-5.14: updating .Announce and .lsm files 2021-08-27 22:13:35 +02:00

README

This package contains Linux man pages for sections 1 through 8.  Some
more information is given in the 'man-pages-x.y.Announce' file.

Homepage
========
For information about the Linux man-pages project, see
http://www.kernel.org/doc/man-pages/index.html.

Bug reports and contributing
============================
If you have corrections and additions to suggest, see
http://www.kernel.org/doc/man-pages/contributing.html
(Although there is a mirror of this repository on GitHub,
please don't report issues via the GitHub issue tracker!)

For further information on contributing, see the CONTRIBUTING file.

Installing and uninstalling
===========================
"make install" will copy these man pages to /usr/local/share/man/man[1-8].

To install to a path different from /usr/local, use
"make install prefix=/install/path".

"make remove" or "make uninstall" will remove any man page in this
distribution from its destination.  Use with caution, and remember to
use "prefix" if desired, as with the "install" target.

To install only a specific man section (mandir) such as man3, use
"make install-man3".  Similar syntax can be used to uninstall a
specific man section, such as man7: "make uninstall-man7".

"make" or "make all" will perform "make uninstall" followed by "make
install".

Consider using multiple threads (at least 2) when installing
these man pages, as the Makefile is optimized for multiple threads:
"make -j install".

Copyrights
==========
See the 'man-pages-x.y.Announce' file.