]> git.saurik.com Git - bison.git/blame - lib/get-errno.c
* src/Makefile.am (yacc): Quote target action commands properly so
[bison.git] / lib / get-errno.c
CommitLineData
02650b7f 1/* get-errno.c - get and set errno.
4bebc88e 2
02650b7f 3 Copyright (C) 2002, 2006 Free Software Foundation, Inc.
4bebc88e
PE
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option)
8 any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software Foundation,
0fb669f9 17 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
4bebc88e
PE
18
19/* Written by Paul Eggert. */
20
231ed89a 21#include <config.h>
4bebc88e
PE
22
23#include "get-errno.h"
24
231ed89a
PE
25#include <errno.h>
26
4bebc88e
PE
27/* Get and set errno. A source file that needs to set or get errno,
28 but doesn't need to test for specific errno values, can use these
29 functions to avoid namespace pollution. For example, a file that
30 defines EQUAL should not include <errno.h>, since <errno.h> might
31 define EQUAL; such a file can include <get-errno.h> instead. */
32
33int
34get_errno (void)
35{
36 return errno;
37}
38
39void
40set_errno (int e)
41{
42 errno = e;
43}