View Single Post
  #1   (View Single Post)  
Old 3rd June 2009
SunSpyda SunSpyda is offline
Port Guard
 
Join Date: Mar 2009
Posts: 20
Question netinet/in.h in OpenBSD 4.4 i386 broken?

I'm trying to get socket programming to work, but it just won't do it. I've tried the same code on Linux and other *nix OSes, and it worked fine, but it just refuses to work on OpenBSD...

The faults occur within that header file. Let's take this *really* simple C code...

Code:
#include <netinet/in.h>
#include <stdio.h>
#include <sys/socket.h>

#define PORT 13

int main( void )
{
    int socket = socket( AF_INET, SOCK_STREAM, 0 );
    struct sockaddr_in address;

    address.sin_family = AF_INET;
    address.sin_port = PORT;

    puts( "\nInitialization complete.\n" );

    return 0;
}
As I said, this code works great on other *nix OSes, but not OpenBSD. It just chokes when processing the netinet/in.h file. Any ideas?

I'm using GCC by the way.
Reply With Quote