Dup2 and execl system calls
I know the dup2 call moves a pointer to a file to a destination you specify but what does execl do and how do they work together? execl seems to use commands pulled out of thin air but they're obviously coming from somewhere, how many commands are there? ive only come across 'sort'.
Posted Aug 11, 2020, 9:36 PM UTC
execlexecutes an external command. There are as many commands as there are executables on the system. docsdup2creates an additional handle for a previously opened file. It doesn't affect the actual file. docsCan you provide some of the context you're seeing?