Re: /sbin/reboot: symbolic link to `halt'

2009-08-16 Thread James Youngman
On Sun, Aug 16, 2009 at 9:22 PM, Sven Joachim wrote: > On 2009-08-16 22:36 +0200, Chris Bannister wrote: > >> I noticed that /sbin/reboot is a symbolic link to /sbin/halt. How does >> the system "know" the difference? > > The program notices how it is called and behaves accordingly.  Programs > wri

Re: /sbin/reboot: symbolic link to `halt'

2009-08-16 Thread Chris Bannister
On Sun, Aug 16, 2009 at 05:22:22PM -0300, Eduardo M KALINOWSKI wrote: > Chris Bannister wrote: > > Hi, > > > > I noticed that /sbin/reboot is a symbolic link to /sbin/halt. How does > > the system "know" the difference? > > > > By checking the name with which the program was called. In C it's

Re: /sbin/reboot: symbolic link to `halt'

2009-08-16 Thread Sven Joachim
On 2009-08-16 22:36 +0200, Chris Bannister wrote: > I noticed that /sbin/reboot is a symbolic link to /sbin/halt. How does > the system "know" the difference? The program notices how it is called and behaves accordingly. Programs written in C can get information about their name in argv[0]. Sv

Re: /sbin/reboot: symbolic link to `halt'

2009-08-16 Thread Eduardo M KALINOWSKI
Chris Bannister wrote: > Hi, > > I noticed that /sbin/reboot is a symbolic link to /sbin/halt. How does > the system "know" the difference? > By checking the name with which the program was called. In C it's available as the first element in the array of command-line arguments that the program

/sbin/reboot: symbolic link to `halt'

2009-08-16 Thread Chris Bannister
Hi, I noticed that /sbin/reboot is a symbolic link to /sbin/halt. How does the system "know" the difference? -- Chris. == I contend that we are both atheists. I just believe in one fewer god than you do. When you understand why you dismiss all the other possible gods, you will understand w