2009/6/30 Alexander Best <alexbes...@math.uni-muenster.de>:
> should be stdout.
>
>
> struct Header *hdr = rom;
>
> int new_fd = open("/dev/stdout", O_RDWR);
>
> printf("SIZE: %d\n",sizeof(*hdr));
>
> write(new_fd, hdr, sizeof(*hdr));
>
> close(new_fd);

You should really be checking what open returns, opening /dev/stdout
for reading is a bit weird not sure if that would work, and most
likely it's already open... Just use fileno(...):-

#include <unistd.h>
#include <stdio.h>

int main(void) {
  write(fileno(stdout), "Hello world!\n", 13);
  return 0;
}

Cheers,
--
Igor
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Reply via email to