https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254120

            Bug ID: 254120
           Summary: Linuxulator: getcwd returns ENOMEM instead of ERANGE
           Product: Base System
           Version: Unspecified
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: [email protected]
          Reporter: [email protected]

% cat getcwd.c 
#include <assert.h>
#include <errno.h>
#include <unistd.h>
#include <stdio.h>

int main() {

  char buf[3];
  assert(getcwd(buf, sizeof(buf)) == NULL);
  if (errno != ERANGE) {    
    perror("getcwd");
  }

  return 0;
}
% pwd | wc -c
      29
% /compat/linux/bin/cc getcwd.c -o getcwd
% ./getcwd 
getcwd: Cannot allocate memory

On the Linux side getcwd is clearly documented to return ERANGE and
at least Mono actually expects it:
https://github.com/mono/mono/blob/da11592cbea4269971f4b1f9624769a85cc10660/mono/eglib/gfile-posix.c#L175.

This is mostly relevant for FNA/MonoGame applications.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to