From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 27 Nov 2006 01:44:30 +0300 From: "Dmitry V. Levin" To: ALT Linux Sisyphus discussion list Message-ID: <20061126224430.GB23346@basalt.office.altlinux.org> Mail-Followup-To: ALT Linux Sisyphus discussion list References: <20061126194356.GF31525@osdn.org.ua> <20061126222307.GA12395@rock.home> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="RASg3xLB4tUQ4RcS" Content-Disposition: inline In-Reply-To: <20061126222307.GA12395@rock.home> X-fingerprint: FE4C 93AB E19A 2E4C CB5D 3E4E 7CAB E6AC 9E35 361E Subject: Re: [sisyphus] malloc behaviour X-BeenThere: sisyphus@lists.altlinux.org X-Mailman-Version: 2.1.9rc1 Precedence: list Reply-To: ALT Linux Sisyphus discussion list List-Id: ALT Linux Sisyphus discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Nov 2006 22:44:30 -0000 Archived-At: List-Archive: List-Post: --RASg3xLB4tUQ4RcS Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 27, 2006 at 04:23:07AM +0600, Slava Semushin wrote: > --- Michael Shigorin 2006-11-26 21:43:56 +0200 > +++ Slava Semushin 2006-11-27 04:17:57 +0600 >=20 > MS> =F3=D0=C1=CD=C9=D4 cron (=D4=CF=DE=CE=C5=C5, sysstat): > MS> Date: Sun, 26 Nov 2006 20:20:01 +0200 (EET) > MS> From: root@home (Cron Daemon) > MS> To: root@home > MS> Subject: Cron /usr/lib/sa/sa1 1 1 > MS> realloc: Success >=20 > =EE=D5 =D4=C1=CB =DC=D4=CF =CF=DB=C9=C2=CB=C1. =ED=CE=C5 =CF=C2 =DC= =D4=CF=CA =D3=C9=D4=D5=C1=C3=C9=C9 =E0=D2=C1 =EB=C1=DB=C9=D2=C9=CE =D2=C1= =D3=D3=CB=C1=DA=D9=D7=C1=CC: > malloc()/realloc() =D7 =D3=CC=D5=DE=C1=C5 =CF=DB=C9=C2=CB=C9 =CE=C5 = =D5=D3=D4=C1=CE=C1=D7=CC=C9=D7=C1=C0=D4 errno, =D0=CF=DC=D4=CF=CD=D5 > =C5=D3=CC=C9 =C5=A3 =C9=D3=D0=CF=CC=D8=DA=CF=D7=C1=D4=D8, =D4=CF =CD= =CF=C7=D5=D4 =D0=CF=CC=D5=DE=C9=D4=D8 =D7=CF=D4 =D4=C1=CB=C9=C5 =D2=C5=DA= =D5=CC=D8=D4=C1=D4=D9. malloc(3) =D0=D2=C9=C4=C5=D2=D6=C9=D7=C1=C5=D4=D3=D1 =C4=D2=D5=C7=CF=C7=CF = =CD=CE=C5=CE=C9=D1: "The Unix98 standard requires malloc(), calloc(), and realloc() to set errno to ENOMEM upon failure. Glibc assumes that this is done (and the glibc versions of these routines do this); if you use a private malloc implementation that does not set errno, then certain library routines may fail without having a reason in errno." > =F4=C1=CD =CB=CF=C4 =D4=C9=D0=C1 =D4=C1=CB=CF=C7=CF, =CE=C1=D7=C5=D2= =CE=CF=C5: >=20 > ptr =3D realloc(...); > if (ptr =3D=3D NULL) { > perror("realloc"); > exit(1); > } =E4=CC=D1 =D4=C1=CB=C9=C8 =D3=CC=D5=DE=C1=C5=D7 =C4=C1=D7=CE=CF =D0=D2=C9= =C4=D5=CD=C1=CC=C9 xrealloc. --=20 ldv --RASg3xLB4tUQ4RcS Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQFFahjNfKvmrJ41Nh4RAiv3AJ42ZCWz/naropDP3kdFZE+r6frCegCeOS3W jG5jmvz3rLVW/As3DB4AZFU= =NpTo -----END PGP SIGNATURE----- --RASg3xLB4tUQ4RcS--