Docsity
Docsity

Prepara tus exámenes
Prepara tus exámenes

Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity


Consigue puntos base para descargar
Consigue puntos base para descargar

Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium


Orientación Universidad
Orientación Universidad

Exec Function in Computing: Replacing Processes in Unix-like Systems, Resúmenes de Programación C

Computer ArchitectureOperating SystemsSystem Programming

The exec function in computing is a feature of operating systems that allows an existing process to run a new executable file, replacing the previous one. This functionality is particularly important in Unix-like systems, where it is used to overlay new code without creating a new process. The exec call is available in various programming languages and command interpreters. the nomenclature, effects, return values, and alternatives of the exec function in detail.

Qué aprenderás

  • How does the exec function work in Unix-like systems?
  • What are the effects of using the exec function in a programming language?
  • What is the exec function in computing?

Tipo: Resúmenes

2019/2020

Subido el 15/11/2021

fernando-rc-1
fernando-rc-1 🇲🇽

1 documento

1 / 5

Toggle sidebar

Documentos relacionados


Vista previa parcial del texto

¡Descarga Exec Function in Computing: Replacing Processes in Unix-like Systems y más Resúmenes en PDF de Programación C solo en Docsity! In computing, exec is a functionality of an operating system that runs an executable file in the context of an already existing process, replacing the previous executable. This act is also referred to as an overlay. It is especially important in Unix-like systems, although it exists elsewhere. As no new process is created, the process identifier (PID) does not change, but the machine code, data, heap, and stack of the process are replaced by those of the new program. The exec call is available for many programming languages including compilable languages and some scripting languages. In OS command interpreters, the exec built-in command replaces the shell process with the specified program.[1] Contents 1 Nomenclature 2 Unix, POSIX, and other multitasking systems 2.1 C language prototypes 22 Effects 2.3 Return value 3 DOS operating systems 4 Command interpreters 5 Alternatives 6 Other Systems 7 See also 8 References 9 External links Nomenclature Interfaces to exec and its implementations vary. Depending on programming language it may be accessible via one or more functions, and depending on operating system it may be represented with one or more actual system calls. For this reason exec is sometimes described as a collection of functions. Standard names of such functions in C are execl, execle, execlp, execv, execve, and execvp (see below), but not "exec" itself. The Linux kernel has one corresponding system call named "execve", whereas all aforementioned functions are user-space wrappers around it. Higher-level languages usually provide one call named exec. Unix, POSIX, and other multitasking systems C language prototypes The POSIX standard declares exec functions in the unistd.h header file, in the C language. The same functions are declared in process.h for DOS (see below), 0S/2, and Microsoft Windows. int execl(char const *path, char const *argo, ...); int execle(char const *path, char const *argo0, ..., char const *envp[]); int execlp(char const *file, char const *argo, ...); int execv(char const *path, char const *argv[]); int execve(char const *path, char const *argv[], char const *envp[]); int execvp(char const *file, char const *argv[]); int fexecve(int fd, char *const argv[], char *const envpl[]); Some implementations provide these functions named with a leading underscore (e.g. _execl). The base of each is exec (execute), followed by one or more letters: e - An array of pointers to environment variables is explicitly passed to the new process image. | - Command-line arguments are passed individually (a list) to the function. p - Uses the PATH environment variable to find the file named in the file argument to be executed. v - Command-line arguments are passed to the function as an array (vector) of pointers. path The argument specifies the path name of the file to execute as the new process image. Arguments beginning at argO are pointers to arguments to be passed to the new process image. The argv value is an array of pointers to arguments. argO
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved