diff options
Diffstat (limited to 'unix/tclUnixCompat.c')
-rw-r--r-- | unix/tclUnixCompat.c | 116 |
1 files changed, 59 insertions, 57 deletions
diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c index 30ddb71..8b6a421 100644 --- a/unix/tclUnixCompat.c +++ b/unix/tclUnixCompat.c @@ -164,14 +164,14 @@ TclUnixSetBlockingMode( * * TclpGetPwNam -- * - * Thread-safe wrappers for getpwnam(). See "man getpwnam" for more - * details. + * Thread-safe wrappers for getpwnam(). See "man getpwnam" for more + * details. * * Results: - * Pointer to struct passwd on success or NULL on error. + * Pointer to struct passwd on success or NULL on error. * * Side effects: - * None. + * None. * *--------------------------------------------------------------------------- */ @@ -244,14 +244,14 @@ TclpGetPwNam( * * TclpGetPwUid -- * - * Thread-safe wrappers for getpwuid(). See "man getpwuid" for more - * details. + * Thread-safe wrappers for getpwuid(). See "man getpwuid" for more + * details. * * Results: - * Pointer to struct passwd on success or NULL on error. + * Pointer to struct passwd on success or NULL on error. * * Side effects: - * None. + * None. * *--------------------------------------------------------------------------- */ @@ -347,14 +347,14 @@ FreePwBuf( * * TclpGetGrNam -- * - * Thread-safe wrappers for getgrnam(). See "man getgrnam" for more - * details. + * Thread-safe wrappers for getgrnam(). See "man getgrnam" for more + * details. * * Results: - * Pointer to struct group on success or NULL on error. + * Pointer to struct group on success or NULL on error. * * Side effects: - * None. + * None. * *--------------------------------------------------------------------------- */ @@ -427,14 +427,14 @@ TclpGetGrNam( * * TclpGetGrGid -- * - * Thread-safe wrappers for getgrgid(). See "man getgrgid" for more - * details. + * Thread-safe wrappers for getgrgid(). See "man getgrgid" for more + * details. * * Results: - * Pointer to struct group on success or NULL on error. + * Pointer to struct group on success or NULL on error. * * Side effects: - * None. + * None. * *--------------------------------------------------------------------------- */ @@ -530,14 +530,14 @@ FreeGrBuf( * * TclpGetHostByName -- * - * Thread-safe wrappers for gethostbyname(). See "man gethostbyname" for - * more details. + * Thread-safe wrappers for gethostbyname(). See "man gethostbyname" for + * more details. * * Results: - * Pointer to struct hostent on success or NULL on error. + * Pointer to struct hostent on success or NULL on error. * * Side effects: - * None. + * None. * *--------------------------------------------------------------------------- */ @@ -598,14 +598,14 @@ TclpGetHostByName( * * TclpGetHostByAddr -- * - * Thread-safe wrappers for gethostbyaddr(). See "man gethostbyaddr" for - * more details. + * Thread-safe wrappers for gethostbyaddr(). See "man gethostbyaddr" for + * more details. * * Results: - * Pointer to struct hostent on success or NULL on error. + * Pointer to struct hostent on success or NULL on error. * * Side effects: - * None. + * None. * *--------------------------------------------------------------------------- */ @@ -661,14 +661,14 @@ TclpGetHostByAddr( * * CopyGrp -- * - * Copies string fields of the group structure to the private buffer, - * honouring the size of the buffer. + * Copies string fields of the group structure to the private buffer, + * honouring the size of the buffer. * * Results: - * 0 on success or -1 on error (errno = ERANGE). + * 0 on success or -1 on error (errno = ERANGE). * * Side effects: - * None. + * None. * *--------------------------------------------------------------------------- */ @@ -734,14 +734,14 @@ CopyGrp( * * CopyHostent -- * - * Copies string fields of the hostent structure to the private buffer, - * honouring the size of the buffer. + * Copies string fields of the hostent structure to the private buffer, + * honouring the size of the buffer. * * Results: - * Number of bytes copied on success or -1 on error (errno = ERANGE) + * Number of bytes copied on success or -1 on error (errno = ERANGE) * * Side effects: - * None + * None * *--------------------------------------------------------------------------- */ @@ -796,15 +796,15 @@ CopyHostent( * * CopyPwd -- * - * Copies string fields of the passwd structure to the private buffer, - * honouring the size of the buffer. + * Copies string fields of the passwd structure to the private buffer, + * honouring the size of the buffer. * * Results: - * 0 on success or -1 on error (errno = ERANGE). + * 0 on success or -1 on error (errno = ERANGE). * * Side effects: - * We are not copying the gecos field as it may not be supported on all - * platforms. + * We are not copying the gecos field as it may not be supported on all + * platforms. * *--------------------------------------------------------------------------- */ @@ -862,14 +862,14 @@ CopyPwd( * * CopyArray -- * - * Copies array of NULL-terminated or fixed-length strings to the private - * buffer, honouring the size of the buffer. + * Copies array of NULL-terminated or fixed-length strings to the private + * buffer, honouring the size of the buffer. * * Results: - * Number of bytes copied on success or -1 on error (errno = ERANGE) + * Number of bytes copied on success or -1 on error (errno = ERANGE) * * Side effects: - * None. + * None. * *--------------------------------------------------------------------------- */ @@ -926,14 +926,14 @@ CopyArray( * * CopyString -- * - * Copies a NULL-terminated string to the private buffer, honouring the - * size of the buffer + * Copies a NULL-terminated string to the private buffer, honouring the + * size of the buffer * * Results: - * 0 success or -1 on error (errno = ERANGE) + * 0 success or -1 on error (errno = ERANGE) * * Side effects: - * None + * None * *--------------------------------------------------------------------------- */ @@ -986,25 +986,27 @@ CopyString( int TclWinCPUID( - int index, /* Which CPUID value to retrieve. */ - int *regsPtr) /* Registers after the CPUID. */ + int index, /* Which CPUID value to retrieve. */ + int *regsPtr) /* Registers after the CPUID. */ { int status = TCL_ERROR; /* See: <http://en.wikipedia.org/wiki/CPUID> */ #if defined(__x86_64__) || defined(_M_AMD64) || defined (_M_X64) - __asm__ __volatile__("movq %%rbx, %%rsi \n\t" /* save %rbx */ - "cpuid \n\t" - "xchgq %%rsi, %%rbx \n\t" /* restore the old %rbx */ - : "=a"(regsPtr[0]), "=S"(regsPtr[1]), "=c"(regsPtr[2]), "=d"(regsPtr[3]) - : "a"(index)); + __asm__ __volatile__( + "movq %%rbx, %%rsi \n\t" /* save %rbx */ + "cpuid \n\t" + "xchgq %%rsi, %%rbx \n\t" /* restore the old %rbx */ + : "=a"(regsPtr[0]), "=S"(regsPtr[1]), "=c"(regsPtr[2]), "=d"(regsPtr[3]) + : "a"(index)); status = TCL_OK; #elif defined(__i386__) || defined(_M_IX86) - __asm__ __volatile__("mov %%ebx, %%esi \n\t" /* save %ebx */ - "cpuid \n\t" - "xchg %%esi, %%ebx \n\t" /* restore the old %ebx */ - : "=a"(regsPtr[0]), "=S"(regsPtr[1]), "=c"(regsPtr[2]), "=d"(regsPtr[3]) - : "a"(index)); + __asm__ __volatile__( + "mov %%ebx, %%esi \n\t" /* save %ebx */ + "cpuid \n\t" + "xchg %%esi, %%ebx \n\t" /* restore the old %ebx */ + : "=a"(regsPtr[0]), "=S"(regsPtr[1]), "=c"(regsPtr[2]), "=d"(regsPtr[3]) + : "a"(index)); status = TCL_OK; #else (void)index; |