xref: /netbsd-src/external/gpl3/gdb/dist/sim/common/target-newlib-open.c (revision 88241920d21b339bf319c0e979ffda80c49a2936)
14b169a6bSchristos /* Target errno mappings for newlib/libgloss environment.
2*88241920Schristos    Copyright 1995-2024 Free Software Foundation, Inc.
34b169a6bSchristos    Contributed by Mike Frysinger.
44b169a6bSchristos 
54b169a6bSchristos    This file is part of simulators.
64b169a6bSchristos 
74b169a6bSchristos    This program is free software; you can redistribute it and/or modify
84b169a6bSchristos    it under the terms of the GNU General Public License as published by
94b169a6bSchristos    the Free Software Foundation; either version 3 of the License, or
104b169a6bSchristos    (at your option) any later version.
114b169a6bSchristos 
124b169a6bSchristos    This program is distributed in the hope that it will be useful,
134b169a6bSchristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
144b169a6bSchristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
154b169a6bSchristos    GNU General Public License for more details.
164b169a6bSchristos 
174b169a6bSchristos    You should have received a copy of the GNU General Public License
184b169a6bSchristos    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
194b169a6bSchristos 
204b169a6bSchristos /* This must come before any other includes.  */
214b169a6bSchristos #include "defs.h"
224b169a6bSchristos 
234b169a6bSchristos #include <fcntl.h>
244b169a6bSchristos 
254b169a6bSchristos #include "sim/callback.h"
264b169a6bSchristos 
274b169a6bSchristos /* This file is kept up-to-date via the gennltvals.py script.  Do not edit
284b169a6bSchristos    anything between the START & END comment blocks below.  */
294b169a6bSchristos 
304b169a6bSchristos CB_TARGET_DEFS_MAP cb_init_open_map[] = {
314b169a6bSchristos   /* gennltvals: START */
324b169a6bSchristos #ifdef O_ACCMODE
334b169a6bSchristos   { "O_ACCMODE", O_ACCMODE, (0|1|2) },
344b169a6bSchristos #endif
354b169a6bSchristos #ifdef O_APPEND
364b169a6bSchristos   { "O_APPEND", O_APPEND, 0x0008 },
374b169a6bSchristos #endif
384b169a6bSchristos #ifdef O_CLOEXEC
394b169a6bSchristos   { "O_CLOEXEC", O_CLOEXEC, 0x40000 },
404b169a6bSchristos #endif
414b169a6bSchristos #ifdef O_CREAT
424b169a6bSchristos   { "O_CREAT", O_CREAT, 0x0200 },
434b169a6bSchristos #endif
444b169a6bSchristos #ifdef O_DIRECT
454b169a6bSchristos   { "O_DIRECT", O_DIRECT, 0x80000 },
464b169a6bSchristos #endif
474b169a6bSchristos #ifdef O_DIRECTORY
484b169a6bSchristos   { "O_DIRECTORY", O_DIRECTORY, 0x200000 },
494b169a6bSchristos #endif
504b169a6bSchristos #ifdef O_EXCL
514b169a6bSchristos   { "O_EXCL", O_EXCL, 0x0800 },
524b169a6bSchristos #endif
534b169a6bSchristos #ifdef O_EXEC
544b169a6bSchristos   { "O_EXEC", O_EXEC, 0x400000 },
554b169a6bSchristos #endif
564b169a6bSchristos #ifdef O_NOCTTY
574b169a6bSchristos   { "O_NOCTTY", O_NOCTTY, 0x8000 },
584b169a6bSchristos #endif
594b169a6bSchristos #ifdef O_NOFOLLOW
604b169a6bSchristos   { "O_NOFOLLOW", O_NOFOLLOW, 0x100000 },
614b169a6bSchristos #endif
624b169a6bSchristos #ifdef O_NONBLOCK
634b169a6bSchristos   { "O_NONBLOCK", O_NONBLOCK, 0x4000 },
644b169a6bSchristos #endif
654b169a6bSchristos #ifdef O_RDONLY
664b169a6bSchristos   { "O_RDONLY", O_RDONLY, 0 },
674b169a6bSchristos #endif
684b169a6bSchristos #ifdef O_RDWR
694b169a6bSchristos   { "O_RDWR", O_RDWR, 2 },
704b169a6bSchristos #endif
714b169a6bSchristos #ifdef O_SEARCH
724b169a6bSchristos   { "O_SEARCH", O_SEARCH, 0x400000 },
734b169a6bSchristos #endif
744b169a6bSchristos #ifdef O_SYNC
754b169a6bSchristos   { "O_SYNC", O_SYNC, 0x2000 },
764b169a6bSchristos #endif
774b169a6bSchristos #ifdef O_TRUNC
784b169a6bSchristos   { "O_TRUNC", O_TRUNC, 0x0400 },
794b169a6bSchristos #endif
804b169a6bSchristos #ifdef O_WRONLY
814b169a6bSchristos   { "O_WRONLY", O_WRONLY, 1 },
824b169a6bSchristos #endif
834b169a6bSchristos   /* gennltvals: END */
844b169a6bSchristos   { NULL, -1, -1 },
854b169a6bSchristos };
86