···11-// Copyright 2011 Shinichiro Hamaji. All rights reserved.
22-//
33-// Redistribution and use in source and binary forms, with or without
44-// modification, are permitted provided that the following conditions
55-// are met:
66-//
77-// 1. Redistributions of source code must retain the above copyright
88-// notice, this list of conditions and the following disclaimer.
99-//
1010-// 2. Redistributions in binary form must reproduce the above
1111-// copyright notice, this list of conditions and the following
1212-// disclaimer in the documentation and/or other materials
1313-// provided with the distribution.
1414-//
1515-// THIS SOFTWARE IS PROVIDED BY Shinichiro Hamaji ``AS IS'' AND ANY
1616-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1717-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1818-// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Shinichiro Hamaji OR
1919-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2020-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2121-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
2222-// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
2323-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
2424-// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
2525-// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2626-// SUCH DAMAGE.
2727-2828-// A translation table from Mac symbols to Linux's.
2929-3030-RENAME(__stderrp, __darwin_stderr)
3131-RENAME(__stdoutp, __darwin_stdout)
3232-RENAME(__stdinp, __darwin_stdin)
3333-WRAP(stderr)
3434-WRAP(stdout)
3535-WRAP(stdin)
3636-3737-WRAP(fopen)
3838-WRAP(fdopen)
3939-WRAP(freopen)
4040-WRAP(fclose)
4141-WRAP(fread)
4242-WRAP(fwrite)
4343-WRAP(fseek)
4444-WRAP(ftell)
4545-WRAP(rewind)
4646-WRAP(getc)
4747-WRAP(fgetc)
4848-WRAP(ungetc)
4949-WRAP(fgets)
5050-WRAP(putc)
5151-WRAP(fputc)
5252-WRAP(fputs)
5353-WRAP(fscanf)
5454-WRAP(vfscanf)
5555-WRAP(fprintf)
5656-WRAP(vfprintf)
5757-WRAP(fflush)
5858-WRAP(setbuf)
5959-WRAP(setbuffer)
6060-WRAP(ferror)
6161-RENAME(_ferror, __darwin_ferror)
6262-WRAP(fileno)
6363-WRAP(tmpfile)
6464-6565-RENAME(__srget, __darwin_fgetc)
6666-RENAME(__swbuf, __darwin_fputc)
6767-6868-RENAME(__toupper, toupper)
6969-RENAME(__tolower, tolower)
7070-7171-RENAME(opendir$INODE64, opendir)
7272-RENAME(readdir$INODE64, __darwin_readdir64)
7373-WRAP(readdir)
7474-7575-WRAP(stat)
7676-WRAP(fstat)
7777-WRAP(lstat)
7878-RENAME(stat$INODE64, __darwin_stat64)
7979-RENAME(fstat$INODE64, __darwin_fstat64)
8080-RENAME(lstat$INODE64, __darwin_lstat64)
8181-8282-WRAP(open)
8383-8484-WRAP(mmap)
8585-WRAP(sysctl)
8686-8787-RENAME(realpath$DARWIN_EXTSN, realpath)
8888-8989-WRAP(execv)
9090-WRAP(execvp)
9191-WRAP(execl)
9292-WRAP(execlp)
9393-WRAP(execve)
9494-WRAP(execle)
9595-WRAP(posix_spawn)
9696-WRAP(posix_spawnp)
9797-9898-WRAP(posix_spawn_file_actions_init)
9999-WRAP(posix_spawn_file_actions_destroy)
100100-WRAP(posix_spawn_file_actions_addopen)
101101-WRAP(posix_spawn_file_actions_addclose)
102102-WRAP(posix_spawn_file_actions_adddup2)
103103-104104-RENAME(CC_MD5_Init, MD5_Init)
105105-RENAME(CC_MD5_Update, MD5_Update)
106106-RENAME(CC_MD5_Final, MD5_Final)
107107-RENAME(CC_MD5, MD5)
108108-109109-WRAP(__cxa_throw)
110110-111111-RENAME(atexit, __cxa_atexit)
112112-113113-WRAP(signal)
114114-WRAP(sigaction)
115115-WRAP(sigaltstack)
116116-117117-#ifdef __x86_64__
118118-RENAME(__ashldi3, __ashlti3)
119119-RENAME(__ashrdi3, __ashrti3)
120120-RENAME(__cmpdi2, __cmpti2)
121121-RENAME(__divdi3, __divti3)
122122-RENAME(__fixdfdi, __fixdfti)
123123-RENAME(__fixsfdi, __fixsfti)
124124-RENAME(__floatdidf, __floattidf)
125125-RENAME(__floatdisf, __floattisf)
126126-RENAME(__lshrdi3, __lshrti3)
127127-RENAME(__moddi3, __modti3)
128128-RENAME(__udivdi3, __udivti3)
129129-RENAME(__umoddi3, __umodti3)
130130-#endif
131131-132132-// TODO(hamaji): *attr_gettype and *attr_getpshared
133133-WRAP(pthread_mutexattr_settype)
134134-WRAP(pthread_mutexattr_setpshared)
135135-WRAP(pthread_rwlockattr_setpshared)
136136-137137-WRAP(dlopen)
138138-WRAP(dlclose)
139139-WRAP(dlerror)
140140-WRAP(dlsym)
141141-// TODO(hamaji): dladdr?
142142-143143-RENAME(_ZNSt12__basic_fileIcE8sys_openEP7__sFILESt13_Ios_Openmode,
144144- _ZNSt12__basic_fileIcE8sys_openEP8_IO_FILESt13_Ios_Openmode)
145145-146146-WRAP(uname)
147147-148148-// TODO(hamaji): Not sure if this is right...
149149-RENAME(select$1050, select)
150150-151151-WRAP(qsort_r)
152152-153153-WRAP(newlocale)
154154-155155-WRAP(compat_mode)