Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Sep 2023 12:53:45 +0300
From:      Dmitry Chagin <dchagin@freebsd.org>
To:        Rocky Hotas <rockyhotas@post.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Error while building a kernel module with mkdir(2)
Message-ID:  <ZQlvqfOZ3AwluExw@heemeyer.club>
In-Reply-To: <trinity-2c27b4d2-a301-466b-941e-2577e4886a49-1695071577376@3c-app-mailcom-lxa16>
References:  <trinity-2c27b4d2-a301-466b-941e-2577e4886a49-1695071577376@3c-app-mailcom-lxa16>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Sep 18, 2023 at 11:12:57PM +0200, Rocky Hotas wrote:
> Hello!
> I hope this is the right ML to discuss about this issue. I am trying to
> build the example kernel module presented in paragraph 2.1 of
> 
> Designing BSD Rootkits: An Introduction to Kernel Hacking
> by Joseph Kong
> 
> However, I get this error:
> 
> mkdir_hook.c:42:9: error: implicit declaration of function 'mkdir' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
>         return(mkdir(td, syscall_args));
>                ^
> mkdir_hook.c:57:45: error: use of undeclared identifier 'mkdir'
>                         sysent[SYS_mkdir].sy_call = (sy_call_t *)mkdir;
> 
> mkdir(2) requires `#include <sys/stat.h>' and I added it (while it was
> not in the code from the book), but nothing changes.
> 
> What's still wrong?
> 

No more mkdir, look for kern_mkdirat at syscallsubr.h





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ZQlvqfOZ3AwluExw>