1 /* Copyright (C) 2001-2024 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, see
16 <https://www.gnu.org/licenses/>. */
18 #include <shlib-compat.h>
20 /* For Linux/Alpha we have to make the wordexp symbols versioned. */
21 #define wordexp(words, pwordexp, flags) \
22 __new_wordexp (words, pwordexp, flags)
24 #include <posix/wordexp.c>
26 versioned_symbol (libc
, __new_wordexp
, wordexp
, GLIBC_2_2_2
);
29 #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2_2)
30 /* The old, incorrect wordexp_t definition. */
33 int we_wordc
; /* Count of words matched. */
34 char **we_wordv
; /* List of expanded words. */
35 int we_offs
; /* Slots to reserve in `we_wordv'. */
40 attribute_compat_text_section
41 __old_wordexp (const char *words
, old_wordexp_t
*pwordexp
, int flags
)
46 we
.we_wordc
= pwordexp
->we_wordc
;
47 we
.we_wordv
= pwordexp
->we_wordv
;
48 we
.we_offs
= pwordexp
->we_offs
;
50 result
= __new_wordexp (words
, &we
, flags
);
52 pwordexp
->we_wordc
= we
.we_wordc
;
53 pwordexp
->we_wordv
= we
.we_wordv
;
54 pwordexp
->we_offs
= we
.we_offs
;
58 compat_symbol (libc
, __old_wordexp
, wordexp
, GLIBC_2_1
);