diff options
author | dfr <dfr@FreeBSD.org> | 1999-01-09 15:03:06 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 1999-01-09 15:03:06 +0000 |
commit | 5eefcec6b500800ee7a3c1d70b3f062a5b46324b (patch) | |
tree | 83e66b7a4adec2b507d7305717299f32b935addc /share | |
parent | 24b62c894f6eedf71185e326e377b40bfe3aa113 (diff) | |
download | FreeBSD-src-5eefcec6b500800ee7a3c1d70b3f062a5b46324b.zip FreeBSD-src-5eefcec6b500800ee7a3c1d70b3f062a5b46324b.tar.gz |
Use modstat(2) to get the syscall number.
Diffstat (limited to 'share')
-rw-r--r-- | share/examples/kld/syscall/test/call.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/share/examples/kld/syscall/test/call.c b/share/examples/kld/syscall/test/call.c index da834ea..0e4b70e 100644 --- a/share/examples/kld/syscall/test/call.c +++ b/share/examples/kld/syscall/test/call.c @@ -23,11 +23,13 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: call.c,v 1.1 1999/01/09 14:26:22 dfr Exp $ */ #include <stdio.h> #include <sys/syscall.h> +#include <sys/types.h> +#include <sys/module.h> static void usage (void); @@ -43,11 +45,10 @@ main(int argc, char **argv) { char *endptr; int syscall_num; + struct module_stat stat; - if (argc != 2) - usage (); - syscall_num = strtol (argv[1], &endptr, 0); - if (syscall_num == 0 && argv[1] == endptr) - errx (1, "Bad number `%s'", argv[1]); + stat.version = sizeof(stat); + modstat(modfind("syscall"), &stat); + syscall_num = stat.data.intval; return syscall (syscall_num); } |