Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - shutdown: (4 Items)
   
shutdown  
There seems to be two shutdown functions.  One in sys/socket.h and one in sys/shutdown.h.  They both take the same kind 
of argument. Are they the same?  

Can a program linked with the socket library call the shutdown function that can reboot the machine or will endup trying
 to shutdown a socket ;-)

- Mario
Re: shutdown  
On Thu, Sep 04, 2008 at 02:27:33PM -0400, Mario Charest wrote:
> 
> There seems to be two shutdown functions.  One in sys/socket.h and one in sys/shutdown.h.  They both take the same 
kind of argument. Are they the same?  
> 
> Can a program linked with the socket library call the shutdown function that can reboot the machine or will endup 
trying to shutdown a socket ;-)

They're different.  The imposter's in libshutdown.a and doesn't
appear to be docked AFAICT.  You should get a conflict at link
time if you're trying to bring them both in.

-seanb
Re: shutdown  
> On Thu, Sep 04, 2008 at 02:27:33PM -0400, Mario Charest wrote:
> > 
> > There seems to be two shutdown functions.  One in sys/socket.h and one in 
> sys/shutdown.h.  They both take the same kind of argument. Are they the same? 
>  
> > 
> > Can a program linked with the socket library call the shutdown function that
>  can reboot the machine or will endup trying to shutdown a socket ;-)
> 
> They're different.  The imposter's in libshutdown.a and doesn't
> appear to be docked AFAICT.  You should get a conflict at link
> time if you're trying to bring them both in.
> 
> -seanb

Haven't check on 6.4 but in 6.3.2 sys/shutdown.h will give a compiler error unless stdint.h is included prior to 
including sys/shutdown.h.


I guess that's too lake to change the function name in libshutdown, the damage is done?

Re: shutdown  
On Thu, Sep 04, 2008 at 03:35:30PM -0400, Mario Charest wrote:
> > On Thu, Sep 04, 2008 at 02:27:33PM -0400, Mario Charest wrote:
> > > 
> > > There seems to be two shutdown functions.  One in sys/socket.h and one in 
> > sys/shutdown.h.  They both take the same kind of argument. Are they the same? 
> >  
> > > 
> > > Can a program linked with the socket library call the shutdown function that
> >  can reboot the machine or will endup trying to shutdown a socket ;-)
> > 
> > They're different.  The imposter's in libshutdown.a and doesn't
> > appear to be docked AFAICT.  You should get a conflict at link
> > time if you're trying to bring them both in.
> > 
> > -seanb
> 
> Haven't check on 6.4 but in 6.3.2 sys/shutdown.h will give a compiler error unless stdint.h is included prior to 
including sys/shutdown.h.
> 
> 
> I guess that's too lake to change the function name in libshutdown, the damage is done?

It's probably possible to change it since it's only in a
static library.  It would mean updating everything that
calls it and a release note.  I'll make a PR.

-seanb