summaryrefslogtreecommitdiff
path: root/user1.c
blob: 9e0c7310f4685fa52b14bd6a9632bfe40c9851fc (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
int
fork()
{
  asm("mov $1, %eax");
  asm("int $48");
}

void
cons_putc(int c)
{
  asm("mov $4, %eax");
  asm("int $48");
}

int
puts(char *s)
{
  int i;

  for(i = 0; s[i]; i++)
    cons_putc(s[i]);
  return i;
}

main()
{
  int pid;
  pid = fork();
  if(pid == 0){
    cons_putc('C');
  } else {
    cons_putc('P');
  }
  while(1)
    ;
}