From cd97c9668814f7ec6d03e3c7e3653a92b97651e6 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 1 Aug 2012 10:42:38 -0700 Subject: Clean up mkstemp64/mkostemp64 for O_LARGEFILE==0. --- misc/mkostemp.c | 6 +++++- misc/mkostemp64.c | 7 ++++++- misc/mkstemp.c | 6 +++++- misc/mkstemp64.c | 7 ++++++- 4 files changed, 22 insertions(+), 4 deletions(-) (limited to 'misc') diff --git a/misc/mkostemp.c b/misc/mkostemp.c index b78554bd01..2c5b272537 100644 --- a/misc/mkostemp.c +++ b/misc/mkostemp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1998, 1999, 2001, 2007, 2009 Free Software Foundation, Inc. +/* Copyright (C) 1998-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -33,3 +33,7 @@ mkostemp (template, flags) { return __gen_tempname (template, 0, flags, __GT_FILE); } + +#if !defined O_LARGEFILE || O_LARGEFILE == 0 +weak_alias (mkostemp, mkostemp64) +#endif diff --git a/misc/mkostemp64.c b/misc/mkostemp64.c index b7a803a932..104e6d98ad 100644 --- a/misc/mkostemp64.c +++ b/misc/mkostemp64.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2007, 2009 Free Software Foundation, Inc. +/* Copyright (C) 2000-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -19,6 +19,9 @@ #include #include +/* If O_LARGEFILE is zero, mkostemp.c defines mkostemp64 as an alias. */ +#if defined O_LARGEFILE && O_LARGEFILE != 0 + /* Generate a unique temporary file name from TEMPLATE. The last six characters of TEMPLATE must be "XXXXXX"; they are replaced with a string that makes the filename unique. @@ -30,3 +33,5 @@ mkostemp64 (template, flags) { return __gen_tempname (template, 0, flags | O_LARGEFILE, __GT_FILE); } + +#endif diff --git a/misc/mkstemp.c b/misc/mkstemp.c index c03516bb7b..c10bdd9af0 100644 --- a/misc/mkstemp.c +++ b/misc/mkstemp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1998, 1999, 2001, 2007, 2009 Free Software Foundation, Inc. +/* Copyright (C) 1998-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -32,3 +32,7 @@ mkstemp (template) { return __gen_tempname (template, 0, 0, __GT_FILE); } + +#if !defined O_LARGEFILE || O_LARGEFILE == 0 +weak_alias (mkstemp, mkstemp64) +#endif diff --git a/misc/mkstemp64.c b/misc/mkstemp64.c index ba4a6e28f5..3667c4b95f 100644 --- a/misc/mkstemp64.c +++ b/misc/mkstemp64.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2007, 2009 Free Software Foundation, Inc. +/* Copyright (C) 2000-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -19,6 +19,9 @@ #include #include +/* If O_LARGEFILE is zero, mkstemp.c defines mkstemp64 as an alias. */ +#if defined O_LARGEFILE && O_LARGEFILE != 0 + /* Generate a unique temporary file name from TEMPLATE. The last six characters of TEMPLATE must be "XXXXXX"; they are replaced with a string that makes the filename unique. @@ -29,3 +32,5 @@ mkstemp64 (template) { return __gen_tempname (template, 0, O_LARGEFILE, __GT_FILE); } + +#endif -- cgit 1.4.1