mirror of
https://github.com/qemu/qemu.git
synced 2024-11-28 22:33:36 +08:00
4bd802b209
Clean up includes so that osdep.h is included first and headers
which it implies are not included manually.
This commit was created with scripts/clean-includes, with the changes
to the following files manually reverted:
contrib/libvhost-user/libvhost-user-glib.h
contrib/libvhost-user/libvhost-user.c
contrib/libvhost-user/libvhost-user.h
contrib/plugins/hotblocks.c
contrib/plugins/hotpages.c
contrib/plugins/howvec.c
contrib/plugins/lockstep.c
linux-user/mips64/cpu_loop.c
linux-user/mips64/signal.c
linux-user/sparc64/cpu_loop.c
linux-user/sparc64/signal.c
linux-user/x86_64/cpu_loop.c
linux-user/x86_64/signal.c
target/s390x/gen-features.c
tests/fp/platform.h
tests/migration/s390x/a-b-bios.c
tests/plugin/bb.c
tests/plugin/empty.c
tests/plugin/insn.c
tests/plugin/mem.c
tests/test-rcu-simpleq.c
tests/test-rcu-slist.c
tests/test-rcu-tailq.c
tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c
contrib/plugins/, tests/plugin/, and tests/test-rcu-slist.c appear not
to include osdep.h intentionally. The remaining reverts are the same
as in commit bbfff19688
.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201113061216.2483385-1-armbru@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Tested-by: Thomas Huth <thuth@redhat.com>
Acked-by: Cornelia Huck <cohuck@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Acked-by: Alexander Bulekov <alxndr@bu.edu>
60 lines
2.0 KiB
C
60 lines
2.0 KiB
C
/*
|
|
* FUSE: Filesystem in Userspace
|
|
* Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu>
|
|
*
|
|
* This program can be distributed under the terms of the GNU LGPLv2.
|
|
* See the file COPYING.LIB
|
|
*/
|
|
|
|
#include <pthread.h>
|
|
|
|
/*
|
|
* Versioned symbols cannot be used in some cases because it
|
|
* - confuse the dynamic linker in uClibc
|
|
* - not supported on MacOSX (in MachO binary format)
|
|
*/
|
|
#if (!defined(__UCLIBC__) && !defined(__APPLE__))
|
|
#define FUSE_SYMVER(x) __asm__(x)
|
|
#else
|
|
#define FUSE_SYMVER(x)
|
|
#endif
|
|
|
|
#ifndef USE_UCLIBC
|
|
#define fuse_mutex_init(mut) pthread_mutex_init(mut, NULL)
|
|
#else
|
|
/* Is this hack still needed? */
|
|
static inline void fuse_mutex_init(pthread_mutex_t *mut)
|
|
{
|
|
pthread_mutexattr_t attr;
|
|
pthread_mutexattr_init(&attr);
|
|
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ADAPTIVE_NP);
|
|
pthread_mutex_init(mut, &attr);
|
|
pthread_mutexattr_destroy(&attr);
|
|
}
|
|
#endif
|
|
|
|
#ifdef HAVE_STRUCT_STAT_ST_ATIM
|
|
/* Linux */
|
|
#define ST_ATIM_NSEC(stbuf) ((stbuf)->st_atim.tv_nsec)
|
|
#define ST_CTIM_NSEC(stbuf) ((stbuf)->st_ctim.tv_nsec)
|
|
#define ST_MTIM_NSEC(stbuf) ((stbuf)->st_mtim.tv_nsec)
|
|
#define ST_ATIM_NSEC_SET(stbuf, val) (stbuf)->st_atim.tv_nsec = (val)
|
|
#define ST_CTIM_NSEC_SET(stbuf, val) (stbuf)->st_ctim.tv_nsec = (val)
|
|
#define ST_MTIM_NSEC_SET(stbuf, val) (stbuf)->st_mtim.tv_nsec = (val)
|
|
#elif defined(HAVE_STRUCT_STAT_ST_ATIMESPEC)
|
|
/* FreeBSD */
|
|
#define ST_ATIM_NSEC(stbuf) ((stbuf)->st_atimespec.tv_nsec)
|
|
#define ST_CTIM_NSEC(stbuf) ((stbuf)->st_ctimespec.tv_nsec)
|
|
#define ST_MTIM_NSEC(stbuf) ((stbuf)->st_mtimespec.tv_nsec)
|
|
#define ST_ATIM_NSEC_SET(stbuf, val) (stbuf)->st_atimespec.tv_nsec = (val)
|
|
#define ST_CTIM_NSEC_SET(stbuf, val) (stbuf)->st_ctimespec.tv_nsec = (val)
|
|
#define ST_MTIM_NSEC_SET(stbuf, val) (stbuf)->st_mtimespec.tv_nsec = (val)
|
|
#else
|
|
#define ST_ATIM_NSEC(stbuf) 0
|
|
#define ST_CTIM_NSEC(stbuf) 0
|
|
#define ST_MTIM_NSEC(stbuf) 0
|
|
#define ST_ATIM_NSEC_SET(stbuf, val) do { } while (0)
|
|
#define ST_CTIM_NSEC_SET(stbuf, val) do { } while (0)
|
|
#define ST_MTIM_NSEC_SET(stbuf, val) do { } while (0)
|
|
#endif
|