🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #745

binutils-2.0

#745
From: Aki Atoji
Date: Sun, 06 Sep 1992 17:52
60 lines
2973 bytes
Older SYSV R3 machines do not have rename() call, causing linking of
binutils/ar to abort with an unresolved error.

The following is a patch to libiberty/functions.def and a trivial new file
libiberty/rename.c to solve the above problem.

Host system:  ISC 2.0.2 (any stock SVR3)
Binutils-2.0 configured with:  configure i386v
Binutils-2.0 built with:       make CC="gcc" CFLAGS="-O2 -g"

==============================================================================

*** functions.def~	Sun Sep  6 10:18:44 1992
--- functions.def	Sun Sep  6 10:13:35 1992
***************
*** 24,29 ****
--- 24,30 ----
  DEF(memmove, PTR, (s1, s2, length), PTR s1 AND CONST PTR s2 AND size_t length)
  DEF(memset, PTR, (s, val, length), PTR s AND int val AND size_t length )
  DEF(random, long int, (), NOTHING)
+ DEF(rename, int, (from, to), CONST char *from AND CONST char *to)
  DEF(rindex, char*, (s, c), char *s AND int c)
  DEF(strchr, char*, (s, c), CONST char *s AND int c)
  DEF(strdup, char*, (s1), char * s1)

=================================rename.c=====================================
/* 
 * emulate rename() on AKOS realtime kernel.
 * rename.c  Copyright (C) 1992,  Aki Atoji   aki@akix.uucp

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
*/

int rename (const char *from, const char *to)
{
  int result;
  return (result = link(from, to)) ? result : unlink(from);
}

===========================================================================

---------------------------------------------------------------------------
Aki Atoji   Graphics, Networking, Embedded Realtime and Japanese Consulting
           aki@akix.uucp                      crash!akix!aki@trout.nosc.mil

"What Vegemite is to Australians, what Natto is to Japanese.  Now, don't
 even ask about this Peanut Butter and Jelley stuff."   -- Aki
---------------------------------------------------------------------------
Technical Details
Message-ID: <m0mRQmj-00003uC@akix.uucp>
Path: arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!darwin.sura.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!akix.UUCP!aki

Show Full Headers
Complete Article Headers
Newsgroups: gnu.utils.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!darwin.sura.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!akix.UUCP!aki
From: aki@akix.UUCP (Aki Atoji)
Subject: binutils-2.0
Message-ID: <m0mRQmj-00003uC@akix.uucp>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Sun, 6 Sep 1992 17:52:00 GMT
Approved: bug-gnu-utils@prep.ai.mit.edu
Lines: 61