* cygmalloc.h (MALLOC_FAILURE_ACTION): Define empty.

* cygwin.din (posix_madvise): Export.
	(posix_memalign): Export.
	* fhandler.cc (fhandler_base::fpathconf): Return useful values in
	_PC_VDISABLE, _PC_SYNC_IO and _PC_SYMLINK_MAX cases.
	* malloc_wrapper.cc (malloc): Set errno here since it's not set in
	dlmalloc.c anymore.
	(realloc): Ditto.
	(calloc): Ditto.
	(memalign): Ditto.
	(valloc): Ditto.
	(posix_memalign): New function.
	* mmap.cc (posix_madvise): New function.
	* sysconf.cc (get_open_max): New function.
	(get_page_size): Ditto.
	(get_nproc_values): Ditto.
	(get_avphys): Ditto.
	(sc_type): New type.
	(sca): New array to map _SC_xxx options to sysconf return values.
	(sysconf): Reimplement using sca array.
	* include/limits.h: Add all missing values as defined by SUSv3.
	* include/pthread.h (PTHREAD_DESTRUCTOR_ITERATIONS): Move definition
	to sys/limits.h.
	(PTHREAD_KEYS_MAX): Ditto.
	* include/semaphore.h (SEM_VALUE_MAX): Ditto.
	* include/cygwin/stdlib.h (posix_memalign): Declare.
	* include/cygwin/version.h: Bump API minor number.
	* include/sys/mman.h: Add posix_madvise flags.
	(posix_madvise): Declare.
	* include/sys/termios.h (_POSIX_VDISABLE): Move definition to
	sys/limits.h.
This commit is contained in:
Corinna Vinschen
2007-02-07 17:22:40 +00:00
parent 0e37a2e6e5
commit 59e3b6ca7d
14 changed files with 563 additions and 179 deletions

View File

@@ -1,6 +1,6 @@
/* sys/mman.h
Copyright 1996, 1997, 1998, 2000, 2001 Red Hat, Inc.
Copyright 1996, 1997, 1998, 2000, 2001, 2003, 2005, 2007 Red Hat, Inc.
This file is part of Cygwin.
@@ -47,6 +47,15 @@ extern "C" {
#define MS_SYNC 2
#define MS_INVALIDATE 4
/*
* Flags for posix_madvise.
*/
#define POSIX_MADV_NORMAL 0
#define POSIX_MADV_SEQUENTIAL 1
#define POSIX_MADV_RANDOM 2
#define POSIX_MADV_WILLNEED 3
#define POSIX_MADV_DONTNEED 4
#ifndef __INSIDE_CYGWIN__
extern void *mmap (void *__addr, size_t __len, int __prot, int __flags, int __fd, off_t __off);
#endif
@@ -56,6 +65,8 @@ extern int msync (void *__addr, size_t __len, int __flags);
extern int mlock (const void *__addr, size_t __len);
extern int munlock (const void *__addr, size_t __len);
extern int posix_madvise (void *__addr, size_t __len, int __advice);
#ifdef __cplusplus
};
#endif /* __cplusplus */

View File

@@ -1,6 +1,7 @@
/* sys/termios.h
Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006 Red Hat, Inc.
Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006,
2007 Red Hat, Inc.
This file is part of Cygwin.
@@ -233,10 +234,6 @@ POSIX commands */
#define NCCS 18
/* `c_cc' member of 'struct termios' structure can be disabled by
using the value _POSIX_VDISABLE. */
#define _POSIX_VDISABLE '\0'
/* Compare a character C to a value VAL from the `c_cc' array in a
`struct termios'. If VAL is _POSIX_VDISABLE, no character can match it. */
#define CCEQ(val, c) ((c) == (val) && (val) != _POSIX_VDISABLE)