Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Jan 2015 05:27:16 +0200
From:      "Ivan \"Rambius\" Ivanov" <rambiusparkisanius@gmail.com>
To:        Mark Johnston <markjdb@gmail.com>
Cc:        "mail.list freebsd-questions" <freebsd-questions@freebsd.org>
Subject:   Re: modfind() returns -1
Message-ID:  <CAE9rwzMG6V=qr9=KuvdgKjcWCRY88FVUSBxEzfPMvRkCh50WzA@mail.gmail.com>
In-Reply-To: <20150120004633.GA5448@charmander.picturesperfect.net>
References:  <CAE9rwzNtUkBMzSskVigiW7hQH0NcHrovCv1UOoTrhwRp_JkUZQ@mail.gmail.com> <20150120004633.GA5448@charmander.picturesperfect.net>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
Hello,

On 1/20/15, Mark Johnston <markjdb@gmail.com> wrote:
> On Mon, Jan 19, 2015 at 06:17:10AM +0200, Ivan "Rambius" Ivanov wrote:
>> Hello,
>>
>> I am trying to implement a simple system call module, but after I
>> install it and try to find its offset with modfind, I somehow get -1.
>>
>> [...]
>> Here is the code that tries to invoke that system call:
>>
>> $ cat interface.c
>> #include <stdio.h>
>> #include <stdlib.h>
>> #include <unistd.h>
>> #include <sys/syscall.h>
>> #include <sys/types.h>
>> #include <sys/module.h>
>>
>> int main(int argc, char *argv[]) {
>>   int syscall_num;
>>   struct module_stat stat;
>>   int mod_id;
>>
>>   stat.version = sizeof(stat);
>>   mod_id = modfind("sc_example_no_args");
>
> Does it work if you instead look up "sys/sc_example_no_args"?
>

Yes, it works with

  mod_id = modfind("sys/sc_example_no_args");

Thank you very much for your help. Can you explain though why prefixed
with sys/ ?

Regards
Rambius
-- 
Tangra Mega Rock: http://www.radiotangra.com



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?CAE9rwzMG6V=qr9=KuvdgKjcWCRY88FVUSBxEzfPMvRkCh50WzA>