[H-GEN] socket options under linux

Jason Parker ph330812 at student.uq.edu.au
Sat Dec 13 11:18:17 EST 1997


Okay.

A bit of a technical question for all you serious people who couldn't
be bothered listening to the chat channel.

I've got a chunk of code I'm trying to (re)port to Linux, and
hopefully not break for too many other unixes while I am at the job.
[Okay, okay.  The source in question is hunt(8) from the bsd-games[1]
code.  Happy?  :)]

The code in question uses the result of this call for an if statement,
which the compiler barfs at:

setsockopt(Socket, SOL_SOCKET, SO_USELOOPBACK, &msg, sizeof msg)

[2]

The compiler says that I should declare what SO_USELOOPBACK is, at
which point, I hang my head in shame, for I know not what to do about
it.  Can anyone give me a useful[1] suggestion about how to alter this
line to keep the compiler happy, but make it do something sensible?
Sockets are not my strong point (indeed, that's the whole point of the
project---to learn more about them by working with them, but I need a
working executable first...) so any help, pointers to FAQ's, books,
and the like will be appreciated.

Come on, I know that someone can solve this one for me.  :)

Jason
ph330812 at student.uq.edu.au

[1] : James, et al.  No, installing *BSD instead is not an option.
      I'd like it to work under my preferred flavour of unix.  :P  :)

[2] : Now that I look at it, the use of "sizeof" looks a bit dodgy. 
      But I didn't write it.  :)  And I think it *is* actually valid. 
      What*ever*.  This is pretty crufty code.  :)

-----
ph330812 at student.uq.edu.au | NetHack addict^H^H^H^H^H^H player.
Ascended:  Priest(2), Valkyrie(1), and Caveman(1) Next:  Rogue.
/Real/ games run under *Unix*.  cf:  NetHack, Doom, Quake, etc.
Visit the One Meg Plan, at:  `finger nooks at azure.humbug.org.au'

----------------------- HUMBUG General List --------------------------------
echo "unsubscribe general" | mail majordomo at humbug.org.au # To Unsubscribe



More information about the General mailing list