[HEADSUP] ttyname_r(3) changes [Was delphij@FreeBSD.org: cvs commit: src/include unistd.h src/lib/libc/gen ttyname.3 ttyname.c src/lib/libc_r/uthread pthread_private.h]

Xin LI delphij at frontfree.net
Fri May 13 10:51:08 PDT 2005


Dear porters,

A commit has been made to make ttyname_r(3) available through unistd.h,
and provide a POSIX standard interface.  This change may have some side
effects if your port is linked against libc_r, libthr (older versions),
or libc using old ttyname_r(3) interface (you may have added some hacks
to work around the difference between the old FreeBSD and POSIX standard
interfaces, which is no longer necessary).

For -HEAD, it is possible to detect whether the system have the change
at the point of __FreeBSD_version 600028.

Please let me know if odd things happen :-)

----- Forwarded message from Xin LI <delphij at FreeBSD.org> -----

Date: Fri, 13 May 2005 16:27:31 +0000 (UTC)
From: Xin LI <delphij at FreeBSD.org>
To: src-committers at FreeBSD.org, cvs-src at FreeBSD.org,
	cvs-all at FreeBSD.org
Subject: cvs commit: src/include unistd.h src/lib/libc/gen ttyname.3
         ttyname.c src/lib/libc_r/uthread pthread_private.h
X-Sieve: CMU Sieve 2.2
Delivered-To: delphij at freebsd.org
Delivered-To: src-committers at freebsd.org
X-FreeBSD-CVS-Branch: HEAD
Precedence: bulk
X-Loop: FreeBSD.ORG
X-Virus-Scanned: by amavisd-new at frontfree.net

delphij     2005-05-13 16:27:31 UTC

  FreeBSD src repository

  Modified files:
    include              unistd.h 
    lib/libc/gen         ttyname.3 ttyname.c 
    lib/libc_r/uthread   pthread_private.h 
  Log:
  Provide more POSIX-complaint ttyname_r(3) interface[1], which is slightly
  different from what has been offered in libc_r (the one spotted in the
  original PR which is found in libthr has already been removed by David's
  commit, which is rev. 1.44 of lib/libthr/thread/thr_private.h):
          - Use POSIX standard prototype for ttyname_r, which is,
                  int ttyname_r(int, char *, size_t);
            Instead of:
                  char *ttyname_r(int, char *, size_t);
            This is to conform IEEE Std 1003.1, 2004 Edition [1].
          - Since we need to use standard errno for return code, include
            errno.h in ttyname.c
          - Update ttyname(3) implementation according to reflect the API
            change.
          - Document new ttyname_r(3) behavior
          - Since we already make use of a thread local storage for
            ttyname(3), remove the BUGS section.
          - Remove conflicting ttyname_r related declarations found in libc_r.
  
  Hopefully this change should not have changed the API/ABI, as the ttyname_r
  symbol was never introduced before the last unistd.h change which happens a
  couple of days before.
  
  [1] http://www.opengroup.org/onlinepubs/009695399/functions/ttyname.html
  
  Requested by:   Tom McLaughlin <tmclaugh sdf lonestar org>
  Through PR:     threads/76938
  Patched by:     Craig Rodrigues <rodrigc crodrigues org> (with minor changes)
  Prompted by:    mezz@
  
  Revision  Changes    Path
  1.78      +1 -1      src/include/unistd.h
  1.12      +26 -11    src/lib/libc/gen/ttyname.3
  1.18      +15 -11    src/lib/libc/gen/ttyname.c
  1.86      +0 -2      src/lib/libc_r/uthread/pthread_private.h

----- End forwarded message -----

Cheers,
-- 
Xin LI <delphij frontfree net>	http://www.delphij.net/
See complete headers for GPG key and other information.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20050514/b1ac7ecb/attachment.bin


More information about the freebsd-ports mailing list