diff options
Diffstat (limited to 'libc/upstream-freebsd/android/include')
| -rw-r--r-- | libc/upstream-freebsd/android/include/freebsd-compat.h | 54 | ||||
| -rw-r--r-- | libc/upstream-freebsd/android/include/libc_private.h | 25 | ||||
| -rw-r--r-- | libc/upstream-freebsd/android/include/namespace.h | 22 | ||||
| -rw-r--r-- | libc/upstream-freebsd/android/include/spinlock.h | 22 | ||||
| -rw-r--r-- | libc/upstream-freebsd/android/include/un-namespace.h | 20 |
5 files changed, 143 insertions, 0 deletions
diff --git a/libc/upstream-freebsd/android/include/freebsd-compat.h b/libc/upstream-freebsd/android/include/freebsd-compat.h new file mode 100644 index 0000000..d5f1425 --- /dev/null +++ b/libc/upstream-freebsd/android/include/freebsd-compat.h @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _BIONIC_FREEBSD_COMPAT_H_included +#define _BIONIC_FREEBSD_COMPAT_H_included + +#define __USE_BSD +#define REPLACE_GETOPT + +/* + * FreeBSD's libc has three symbols for every symbol: + * + * __f will be the actual implementation. + * _f will be a weak reference to __f (used for calls to f from within the library). + * f will be a weak reference to __f (used for calls to f from outside the library). + * + * We collapse this into just the one symbol, f. + */ + +/* Prevent weak reference generation. */ +#define __weak_reference(sym,alias) + +/* Ensure that the implementation itself gets the underscore-free name. */ +#define __sleep sleep +#define __usleep usleep + +/* Redirect internal C library calls to the public function. */ +#define _close close +#define _fcntl fcntl +#define _fstat fstat +#define _nanosleep nanosleep +#define _open open + +/* This one is only needed as long as we have a mix of OpenBSD and FreeBSD stdio. */ +#define _sseek __sseek + +/* This is in BSD's <stdlib.h>. */ +#include <stdint.h> +extern uint32_t arc4random_uniform(uint32_t upper_bound); + +#endif diff --git a/libc/upstream-freebsd/android/include/libc_private.h b/libc/upstream-freebsd/android/include/libc_private.h new file mode 100644 index 0000000..c6a6433 --- /dev/null +++ b/libc/upstream-freebsd/android/include/libc_private.h @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _BIONIC_FREEBSD_LIBC_PRIVATE_H_included +#define _BIONIC_FREEBSD_LIBC_PRIVATE_H_included + +#define STDIO_THREAD_LOCK() /* TODO: until we have the FreeBSD findfp.c, this is useless. */ +#define STDIO_THREAD_UNLOCK() /* TODO: until we have the FreeBSD findfp.c, this is useless. */ + +#define ORIENT(fp, o) /* Only needed for wide-character stream support. */ + +#endif diff --git a/libc/upstream-freebsd/android/include/namespace.h b/libc/upstream-freebsd/android/include/namespace.h new file mode 100644 index 0000000..a980b57 --- /dev/null +++ b/libc/upstream-freebsd/android/include/namespace.h @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _BIONIC_FREEBSD_NAMESPACE_H_included +#define _BIONIC_FREEBSD_NAMESPACE_H_included + +__attribute__((visibility("hidden"))) char* _mktemp(char*); + +#endif diff --git a/libc/upstream-freebsd/android/include/spinlock.h b/libc/upstream-freebsd/android/include/spinlock.h new file mode 100644 index 0000000..f5c3785 --- /dev/null +++ b/libc/upstream-freebsd/android/include/spinlock.h @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _BIONIC_FREEBSD_SPINLOCK_H_included +#define _BIONIC_FREEBSD_SPINLOCK_H_included + +/* TODO: until we have the FreeBSD findfp.c, this is useless. */ + +#endif diff --git a/libc/upstream-freebsd/android/include/un-namespace.h b/libc/upstream-freebsd/android/include/un-namespace.h new file mode 100644 index 0000000..a3f850e --- /dev/null +++ b/libc/upstream-freebsd/android/include/un-namespace.h @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2013 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _BIONIC_FREEBSD_NAMESPACE_H_included +#define _BIONIC_FREEBSD_NAMESPACE_H_included + +#endif |
