]>
Commit | Line | Data |
---|---|---|
04277e02 | 1 | /* Copyright (C) 1996-2019 Free Software Foundation, Inc. |
8a523922 UD |
2 | This file is part of the GNU C Library. |
3 | Contributed by Ulrich Drepper <drepper@cygnus.com> | |
4 | and Paul Janzen <pcj@primenet.com>, 1996. | |
b8fe19fa | 5 | |
8a523922 | 6 | The GNU C Library is free software; you can redistribute it and/or |
41bdb6e2 AJ |
7 | modify it under the terms of the GNU Lesser General Public |
8 | License as published by the Free Software Foundation; either | |
9 | version 2.1 of the License, or (at your option) any later version. | |
b8fe19fa | 10 | |
8a523922 UD |
11 | The GNU C Library is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
41bdb6e2 | 14 | Lesser General Public License for more details. |
b8fe19fa | 15 | |
41bdb6e2 | 16 | You should have received a copy of the GNU Lesser General Public |
59ba27a6 PE |
17 | License along with the GNU C Library; if not, see |
18 | <http://www.gnu.org/licenses/>. */ | |
b8fe19fa RM |
19 | |
20 | #include <errno.h> | |
ec999b8e | 21 | #include <libc-lock.h> |
b8fe19fa RM |
22 | #include <utmp.h> |
23 | ||
8a523922 | 24 | #include "utmp-private.h" |
b8fe19fa | 25 | |
b8fe19fa | 26 | |
8a523922 | 27 | /* We have to use the lock in getutent_r.c. */ |
ab26a24a | 28 | __libc_lock_define (extern, __libc_utmp_lock attribute_hidden) |
8a523922 | 29 | |
b8fe19fa | 30 | |
8a523922 UD |
31 | int |
32 | __getutline_r (const struct utmp *line, struct utmp *buffer, | |
33 | struct utmp **result) | |
34 | { | |
0413b54c | 35 | int retval; |
8a523922 UD |
36 | |
37 | __libc_lock_lock (__libc_utmp_lock); | |
0200214b | 38 | |
0413b54c | 39 | retval = (*__libc_utmp_jump_table->getutline_r) (line, buffer, result); |
b8fe19fa | 40 | |
8a523922 | 41 | __libc_lock_unlock (__libc_utmp_lock); |
b8fe19fa | 42 | |
8a523922 | 43 | return retval; |
b8fe19fa | 44 | } |
59c04e67 | 45 | libc_hidden_def (__getutline_r) |
23396375 | 46 | weak_alias (__getutline_r, getutline_r) |