2.9
[glibc/nacl-glibc.git] / sysdeps / unix / sysv / linux / alpha / wordexp.c
blobc2972e40c26c6f6345816382a8363f2f13c07439
1 /* Copyright (C) 2001, 2004, 2005 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, write to the Free
16 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17 02111-1307 USA. */
19 #include <shlib-compat.h>
21 /* For Linux/Alpha we have to make the wordexp symbols versioned. */
22 #define wordexp(words, pwordexp, flags) \
23 __new_wordexp (words, pwordexp, flags)
25 #include <posix/wordexp.c>
27 versioned_symbol (libc, __new_wordexp, wordexp, GLIBC_2_2_2);
30 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2_2)
31 /* The old, incorrect wordexp_t definition. */
32 typedef struct
34 int we_wordc; /* Count of words matched. */
35 char **we_wordv; /* List of expanded words. */
36 int we_offs; /* Slots to reserve in `we_wordv'. */
37 } old_wordexp_t;
40 int
41 attribute_compat_text_section
42 __old_wordexp (const char *words, old_wordexp_t *pwordexp, int flags)
44 wordexp_t we;
45 int result;
47 we.we_wordc = pwordexp->we_wordc;
48 we.we_wordv = pwordexp->we_wordv;
49 we.we_offs = pwordexp->we_offs;
51 result = __new_wordexp (words, &we, flags);
53 pwordexp->we_wordc = we.we_wordc;
54 pwordexp->we_wordv = we.we_wordv;
55 pwordexp->we_offs = we.we_offs;
57 return result;
59 compat_symbol (libc, __old_wordexp, wordexp, GLIBC_2_1);
60 #endif