cvs commit: src/sbin/ifconfig ifconfig.c src/sys/net if.c if.h

Ken Smith kensmith at cse.Buffalo.EDU
Mon Dec 13 09:37:13 PST 2004


On Mon, Dec 13, 2004 at 10:19:32AM -0700, Warner Losh wrote:
> From: des at des.no (Dag-Erling Smørgrav)
> Subject: Re: cvs commit: src/sbin/ifconfig ifconfig.c src/sys/net if.c if.h
> Date: Mon, 13 Dec 2004 17:50:01 +0100
> 
> > "M. Warner Losh" <imp at bsdimp.com> writes:
> > > Ken Smith <kensmith at cse.Buffalo.EDU> writes:
> > > > int main(void)
> > > int main(int argc, char *argv[])
> > 
> > Both are correct according to the standard.
> 
> The latter is what style(9) implies is the right one for FreeBSD.
> 

Ok, two revisions (and at least two pointy hats) later, modulo above
comment about what style(9) suggests (this is just a quick little
test program so since we've got no intention of using the command
line arguments one could argue less typing is better :-) we have
this.  Thanks to a few other people who have contributed substantially
off-list.  :-)

#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <sys/param.h>
#include <sys/socket.h>
#include "if.h"

int
main(void)
{
        printf("sizeof if_data %zd\n", sizeof(struct if_data));
        printf("offset ifi_mtu %zd\n", offsetof(struct if_data, ifi_mtu));
}

-- 
						Ken Smith
- From there to here, from here to      |       kensmith at cse.buffalo.edu
  there, funny things are everywhere.   |
                      - Theodore Geisel |


More information about the cvs-src mailing list