~laumann/C

c67130969c77780a124aa312cff55ef07a0e8e57 — Thomas Bracht Laumann Jespersen 9 years ago abf3394
Forgot to add utsname.c + ignored a few more executables.

Signed-off-by: Thomas Bracht Laumann Jespersen <laumann.thomas@gmail.com>
2 files changed, 27 insertions(+), 0 deletions(-)

M .gitignore
A begin/utsname.c
M .gitignore => .gitignore +2 -0
@@ 40,4 40,6 @@ begin/hello2
begin/longstring
begin/struct
begin/trigraph
begin/utsname
begin/login
the_c_book.pdf

A begin/utsname.c => begin/utsname.c +25 -0
@@ 0,0 1,25 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/utsname.h>
#include <sys/types.h>

int
main(int argc, char *argv[])
{
	struct utsname name;

	if (uname(&name) == -1) {
		printf("Something went wrong");
		return -1;
	}

	printf("sysname:  %s\n", name.sysname);
	printf("nodename: %s\n", name.nodename);
	printf("release:  %s\n", name.release);
	printf("version:  %s\n", name.version);
	printf("machine:  %s\n", name.machine);

	/* free(name); */

	return 0;
}