Permalink
Browse files

Handle compat_mode, used from uname(1)

This change is suggested by Yoshi. Thanks!
  • Loading branch information...
1 parent 75d921f commit d58a98481454979bae82b1fddb3fc2c0ae14138f @shinh committed Jul 2, 2012
Showing with 10 additions and 0 deletions.
  1. +8 −0 libmac/mac.c
  2. +2 −0 rename.tab
View
@@ -1301,6 +1301,14 @@ locale_t __darwin_newlocale(int category_mask, const char* locale,
return newlocale(linux_category_mask, locale, base);
}
+int __darwin_compat_mode(const char* function, const char* mode) {
+ LOGF("compat_mode: %s %s\n", function, mode);
+ // We don't consider bootstrap, legacy, and error.
+ // http://opensource.apple.com/source/Libc/Libc-763.13/gen/get_compat.c
+ // TODO(hamaji): Support binary operators.
+ return !strcasecmp(mode, "unix2003");
+}
+
__attribute__((constructor)) void initMac() {
__darwin_stdin = __init_darwin_FILE(stdin);
__darwin_stdout = __init_darwin_FILE(stdout);
View
@@ -151,3 +151,5 @@ RENAME(select$1050, select)
WRAP(qsort_r)
WRAP(newlocale)
+
+WRAP(compat_mode)

0 comments on commit d58a984

Please sign in to comment.