summaryrefslogtreecommitdiff
path: root/userspace/add.c
blob: 8f1dc56071163ff88f4bb06ab476a71d6f7d3be7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include <stdio.h>
#include <string.h>
#include "syscalls.c"
#include "../fs/fs.h"

int main(int argc, char **argv) 
{

    sbrk(1024);
    sbrk(1024);
    sbrk(1024);
    write(1,"dupa",4);
    puts("started ADD");

    while(1);
//    FILE *input;
//    input=fopen("input2.txt","r"); //stdin
/*
    int sum=0;
    int i=0;

    while(1);

    char *buf=malloc(256);
    //printf("(buf= 0x%08X)\n",buf);



    while(1)
    {
        char *ret=gets(buf);
	if(ret==NULL)
	{
	    printf("returned NULL. ABORTING");
	    break;
	}
	printf("entered %s: ",buf);

	//buf[strlen(buf)-1]=0; // remove \n
	//process(buf);
    }


    
    while(1)
    {
	printf("enter numer %i: ",i+1);
        fgets(buf,255,input);
	printf("entered %s: ",buf);

	if(buf[1]=='x')break;

	i++;
	sum+=atoi(buf);
    }

    printf("avg = %i \n\n",sum/i);
*/

    execve(15,0,0);
}