summaryrefslogtreecommitdiff
path: root/minix/tests/mod.c
blob: 0226c990994a7fd50aa976b8d1a07154d4864380 (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

/* Code for module to be loaded by test63. */

#include <stdlib.h>
#include <stdio.h>
#include <dlfcn.h>

#include "magic.h"

long cookie = 0;

void exithandler(void);

long modfunction(long v1, long *argcookie, long v2) {
  if(v1 != MAGIC4 || v2 != MAGIC5) {
	fprintf(stderr, "wrong args to modfunction\n");
	exit(1);
  }
  *argcookie = MAGIC3;
  cookie = MAGIC2;
  return MAGIC1;
}

void exithandler(void) {
	/* OK */
}