I cannot reproduce the problem with your code
Will try building got later

Vào Th 2, 19 thg 2, 2024 vào lúc 16:26 Christian Weisgerber
<na...@mips.inka.de> đã viết:
>
> Something isn't right with unveil() and MFS on -current.
>
> The devel/got port doesn't build on MFS, because the template helper
> program that uses unveil/pledge can't open its input file.  Here's
> a simplified case that illustrates the problem:
>
> # mount -tmfs -o-s=2g swap /usr/obj
>
> $ cd /usr/obj
> $ echo hello world >foo
> $ ~/a.out foo
> a.out: open foo: No such file or directory
> $ ~/a.out ${PWD}/foo    # absolute path is fine, though
> $
>
> --------------------
> #include <err.h>
> #include <fcntl.h>
> #include <unistd.h>
>
> int
> main(int argc, char *argv[])
> {
>         int i, fd;
>
>         if (unveil("/", "r") == -1)
>                 err(1, "unveil /");
>
>         for (i = 1; i < argc; i++) {
>                 if ((fd = open(argv[i], O_RDONLY)) == -1)
>                         err(1, "open %s", argv[i]);
>                 else
>                         close(fd);
>         }
>
>         return 0;
> }
>
> --
> Christian "naddy" Weisgerber                          na...@mips.inka.de
>

Reply via email to