-
-
Save sgraham/af5fe768a627061a0257fe4f89a718d7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [scottmg:~]$ pwd | |
| /Users/scottmg | |
| [scottmg:~]$ cat a.c | |
| #include <errno.h> | |
| #include <stdio.h> | |
| #include <sys/stat.h> | |
| #include <unistd.h> | |
| int main() { | |
| for (int count = 0; ; ++count) { | |
| struct stat st; | |
| if (stat("../../usr/bin/env", &st) < 0) { | |
| if (errno == ENOENT || errno == ENOTDIR) { | |
| fprintf(stderr, "got errno: %d (ENOENT=%d, ENOTDIR=%d)\n", errno, ENOENT, ENOTDIR); | |
| char buf[256]; | |
| getcwd(buf, sizeof(buf)); | |
| fprintf(stderr, "cwd: %s\n", buf); | |
| fprintf(stderr, "count=%d\n", count); | |
| } | |
| return 1; | |
| } | |
| } | |
| return 0; | |
| } | |
| [scottmg:~]$ clang a.c -o a | |
| [scottmg:~]$ ./a | |
| got errno: 2 (ENOENT=2, ENOTDIR=20) | |
| cwd: /Users/scottmg | |
| count=504033 |
Author
Ah, thanks for confirming, I was wondering if it was perhaps some internal corp-anti-malware-monitoring thing.
I hear this might be getting fixed in macOS 12.3.
Author
👍
But the question is what will break in 12.3 to take its place?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was able to repro, although it can take a long time to trigger:
So far, I've not been able to trigger it running as root.