-.\" $OpenBSD: execve.2,v 1.56 2022/03/31 17:27:16 naddy Exp $
+.\" $OpenBSD: execve.2,v 1.57 2022/09/24 15:21:21 jmc Exp $
.\" $NetBSD: execve.2,v 1.9 1995/02/27 12:32:25 cgd Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
.\"
.\" @(#)execve.2 8.3 (Berkeley) 1/24/94
.\"
-.Dd $Mdocdate: March 31 2022 $
+.Dd $Mdocdate: September 24 2022 $
.Dt EXECVE 2
.Os
.Sh NAME
.Xr elf 5 .
.Pp
An interpreter file begins with a line of the form:
-.Bd -filled -offset indent
-.Sy #!\&
-.Em interpreter
-.Bq Em arg
-.Ed
+.Pp
+.D1 #! Ar interpreter Op Ar arg
.Pp
When an interpreter file is passed to
.Fn execve ,
the system instead calls
.Fn execve
with the specified
-.Em interpreter .
+.Ar interpreter .
If the optional
-.Em arg
+.Ar arg
is specified, it becomes the first argument to the
-.Em interpreter ,
+.Ar interpreter ,
and the original
.Fa path
becomes the second argument;
When a program is executed as a result of an
.Fn execve
call, it is entered as follows:
-.Bd -literal -offset indent
-main(int argc, char **argv, char **envp)
-.Ed
+.Pp
+.Dl main(int argc, char **argv, char **envp)
.Pp
where
.Fa argc
The number of bytes in the new process's argument list
is larger than the system-imposed limit.
The limit in the system as released is 524288 bytes
-.Pf ( Dv ARG_MAX ) .
+.Pq Dv ARG_MAX .
.It Bq Er EFAULT
The new process file is not as long as indicated by
the size values in its header.
An I/O error occurred while reading from the file system.
.It Bq Er ENFILE
During startup of an
-.Em interpreter ,
+.Ar interpreter ,
the system file table was found to be full.
.El
.Sh SEE ALSO