#include "kernel/types.h"
#include "kernel/stat.h"
#include "user/user.h"
#include "kernel/param.h"

int
main()
{
  int pid = fork();
  if (pid < 0) {
    printf("[pid %d] Fork failed\n", getpid());
    exit(pid);
  }

  if (pid == 0) {
    exit(0);
  }

  int ret = wait(0);
  if (ret != pid) {
    printf("[pid %d] Wait failed\n", getpid());
    exit(ret);
  }

  if (signal(pid, SIGSTOP) == -1)
    printf("[pid %d] Correct return value\n", getpid());
  else
    printf("[pid %d] Incorrect return value\n", getpid());

  exit(0);
}
