home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / gnu / utils / bug / 1497 < prev    next >
Encoding:
Text File  |  1992-09-08  |  2.8 KB  |  74 lines

  1. Newsgroups: gnu.utils.bug
  2. Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!akix.UUCP!aki
  3. From: aki@akix.UUCP (Aki Atoji)
  4. Subject: binutils-2.0
  5. Message-ID: <m0mRQmj-00003uC@akix.uucp>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Sun, 6 Sep 1992 17:52:00 GMT
  10. Approved: bug-gnu-utils@prep.ai.mit.edu
  11. Lines: 61
  12.  
  13. Older SYSV R3 machines do not have rename() call, causing linking of
  14. binutils/ar to abort with an unresolved error.
  15.  
  16. The following is a patch to libiberty/functions.def and a trivial new file
  17. libiberty/rename.c to solve the above problem.
  18.  
  19. Host system:  ISC 2.0.2 (any stock SVR3)
  20. Binutils-2.0 configured with:  configure i386v
  21. Binutils-2.0 built with:       make CC="gcc" CFLAGS="-O2 -g"
  22.  
  23. ==============================================================================
  24.  
  25. *** functions.def~    Sun Sep  6 10:18:44 1992
  26. --- functions.def    Sun Sep  6 10:13:35 1992
  27. ***************
  28. *** 24,29 ****
  29. --- 24,30 ----
  30.   DEF(memmove, PTR, (s1, s2, length), PTR s1 AND CONST PTR s2 AND size_t length)
  31.   DEF(memset, PTR, (s, val, length), PTR s AND int val AND size_t length )
  32.   DEF(random, long int, (), NOTHING)
  33. + DEF(rename, int, (from, to), CONST char *from AND CONST char *to)
  34.   DEF(rindex, char*, (s, c), char *s AND int c)
  35.   DEF(strchr, char*, (s, c), CONST char *s AND int c)
  36.   DEF(strdup, char*, (s1), char * s1)
  37.  
  38. =================================rename.c=====================================
  39. /* 
  40.  * emulate rename() on AKOS realtime kernel.
  41.  * rename.c  Copyright (C) 1992,  Aki Atoji   aki@akix.uucp
  42.  
  43. This program is free software; you can redistribute it and/or modify
  44. it under the terms of the GNU General Public License as published by
  45. the Free Software Foundation; either version 2 of the License, or
  46. (at your option) any later version.
  47.  
  48. This program is distributed in the hope that it will be useful,
  49. but WITHOUT ANY WARRANTY; without even the implied warranty of
  50. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  51. GNU General Public License for more details.
  52.  
  53. You should have received a copy of the GNU General Public License
  54. along with this program; if not, write to the Free Software
  55. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
  56. */
  57.  
  58. int rename (const char *from, const char *to)
  59. {
  60.   int result;
  61.   return (result = link(from, to)) ? result : unlink(from);
  62. }
  63.  
  64. ===========================================================================
  65.  
  66. ---------------------------------------------------------------------------
  67. Aki Atoji   Graphics, Networking, Embedded Realtime and Japanese Consulting
  68.            aki@akix.uucp                      crash!akix!aki@trout.nosc.mil
  69.  
  70. "What Vegemite is to Australians, what Natto is to Japanese.  Now, don't
  71.  even ask about this Peanut Butter and Jelley stuff."   -- Aki
  72. ---------------------------------------------------------------------------
  73.  
  74.