Skip to content

AT_FDCWD undefined? #42

Description

@matthewbauer

I'm getting this issue building gnulib areadlink.c. The source is available here:

https://github.com/coreutils/gnulib/blob/master/lib/areadlink.c

The error is this:

wasm32-unknown-wasi-clang -DHAVE_CONFIG_H -DEXEEXT=\"\" -I. -I..  -I../intl -I../intl -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1    -g -O2 -c -o areadlink.o areadlink.c
areadlink.c:41:13: error: use of undeclared identifier 'AT_FDCWD'
  if (fd != AT_FDCWD)
            ^
areadlink.c:55:24: error: use of undeclared identifier 'AT_FDCWD'
  return careadlinkat (AT_FDCWD, filename, NULL, 0, NULL, careadlinkatcwd);
                       ^
2 errors generated.
make[6]: *** [Makefile:1496: areadlink.o] Error 1

AT_FDCWD should be available in wasi, correct? I can't find any direct references outside of Musl though. If it's not provided, what alternatives are available?

You can repro this with nix:

$ nix build -f channel:nixpkgs-unstable pkgsCross.wasi32.gettext --arg config '{ allowUnsupportedSystem = true; }'

/cc @Ericson2314

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions