* syscalls.cc (getshmlba): New function.

* external.cc (cygwin_internal): Add CW_GET_SHMLBA handling.
	* mmap.cc (mmap64): Call getshmlba to evaluate granularity.
	* winsup.h (getshmlba): Add declaration.
	* include/cygwin/version.h: Bump API minor number.
	* include/sys/cygwin.h (cygwin_getinfo_types): Add CW_GET_SHMLBA.
This commit is contained in:
Corinna Vinschen 2003-11-06 14:33:16 +00:00
parent fad5aef860
commit 6ef3b76be2
7 changed files with 28 additions and 9 deletions

View File

@ -1,3 +1,12 @@
2003-11-06 Corinna Vinschen <corinna@vinschen.de>
* syscalls.cc (getshmlba): New function.
* external.cc (cygwin_internal): Add CW_GET_SHMLBA handling.
* mmap.cc (mmap64): Call getshmlba to evaluate granularity.
* winsup.h (getshmlba): Add declaration.
* include/cygwin/version.h: Bump API minor number.
* include/sys/cygwin.h (cygwin_getinfo_types): Add CW_GET_SHMLBA.
2003-11-06 Christopher Faylor <cgf@redhat.com>
* winsup.h: Declare access_worker.

View File

@ -274,6 +274,10 @@ cygwin_internal (cygwin_getinfo_types t, ...)
set_security_attribute (attribute, psa, sd_buf, sd_buf_size);
return psa->lpSecurityDescriptor ? 0 : -1;
}
case CW_GET_SHMLBA:
{
return getshmlba ();
}
default:
return (DWORD) -1;
}

View File

@ -224,13 +224,14 @@ details. */
97: Export sem_open, sem_close, sem_timedwait, sem_getvalue.
98: Export _tmpfile64.
99: CW_GET_POSIX_SECURITY_ATTRIBUTE addition to external.cc.
100: CW_GET_SHMLBA addition to external.cc.
*/
/* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
#define CYGWIN_VERSION_API_MAJOR 0
#define CYGWIN_VERSION_API_MINOR 99
#define CYGWIN_VERSION_API_MINOR 100
/* There is also a compatibity version number associated with the
shared memory regions. It is incremented when incompatible

View File

@ -74,7 +74,8 @@ typedef enum
CW_CMDLINE,
CW_CHECK_NTSEC,
CW_GET_ERRNO_FROM_WINERROR,
CW_GET_POSIX_SECURITY_ATTRIBUTE
CW_GET_POSIX_SECURITY_ATTRIBUTE,
CW_GET_SHMLBA
} cygwin_getinfo_types;
#define CW_NEXTPID 0x80000000 /* or with pid to get next one */

View File

@ -455,13 +455,7 @@ mmap64 (void *addr, size_t len, int prot, int flags, int fd, _off64_t off)
syscall_printf ("addr %x, len %u, prot %x, flags %x, fd %d, off %D",
addr, len, prot, flags, fd, off);
static DWORD granularity;
if (!granularity)
{
SYSTEM_INFO si;
GetSystemInfo (&si);
granularity = si.dwAllocationGranularity;
}
static DWORD granularity = getshmlba ();
/* Error conditions according to SUSv2 */
if (off % getpagesize ()

View File

@ -1529,6 +1529,14 @@ getpagesize ()
return (int) system_info.dwPageSize;
}
size_t
getshmlba ()
{
if (!system_info.dwAllocationGranularity)
GetSystemInfo (&system_info);
return system_info.dwAllocationGranularity;
}
static int
check_posix_perm (const char *fname, int v)
{

View File

@ -282,6 +282,8 @@ int access_worker (path_conv&, int) __attribute__ ((regparm (2)));
extern "C" int low_priority_sleep (DWORD) __attribute__ ((regparm (1)));
#define SLEEP_0_STAY_LOW INFINITE
size_t getshmlba (void);
/**************************** Exports ******************************/
extern "C" {