Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.c    |    Meh, in C you gotta define EVERYTHING    |    243,242 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 242,666 of 243,242    |
|    Keith Thompson to Scott Lurndal    |
|    Re: srand(0)    |
|    31 Dec 25 15:17:22    |
   
   From: Keith.S.Thompson+u@gmail.com   
      
   scott@slp53.sl.home (Scott Lurndal) writes:   
   > Keith Thompson writes:   
   [...]   
   >>That's not clear. Linux (since 2022) guarantees argc>=1.   
   >   
   > Does it? That seems to be up to the shell, since the exec()   
   > manual pages on the latest Fedora Core release don't indicate   
   > that argv[0] must be initialized or that argc be greater than zero.   
      
   As I understand it, all the exec() functions go through the execve()   
   system call. In 2022, the Linux kernel execve() implementation was   
   modified to guarantee that argc>0 and argv[0]!=NULL in the invoked   
   program. A shell presumably can't bypass that.   
      
   commit dcd46d897adb70d63e025f175a00a89797d31a43   
   Author: Kees Cook    
   Date: 2022-01-31 16:09:47 -0800   
      
    exec: Force single empty string when argv is empty   
      
   --   
   Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com   
   void Void(void) { Void(); } /* The recursive call of the void */   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca