Skip to content
Snippets Groups Projects
Commit 51d664ea authored by Andre Maroneze's avatar Andre Maroneze
Browse files

[libc] add non-POSIX, glibc-specific sys/sysmacros.h

parent a131c462
No related branches found
No related tags found
No related merge requests found
......@@ -237,6 +237,7 @@
(libc/sys/socket.h as libc/sys/socket.h)
(libc/sys/stat.h as libc/sys/stat.h)
(libc/sys/statvfs.h as libc/sys/statvfs.h)
(libc/sys/sysmacros.h as libc/sys/sysmacros.h)
(libc/sys/time.h as libc/sys/time.h)
(libc/sys/times.h as libc/sys/times.h)
(libc/sys/timex.h as libc/sys/timex.h)
......
......@@ -111,6 +111,7 @@
#include "sys/socket.h"
#include "sys/stat.h"
#include "sys/statvfs.h"
#include "sys/sysmacros.h"
#include "sys/time.h"
#include "sys/times.h"
#include "sys/timex.h"
......
/**************************************************************************/
/* */
/* This file is part of Frama-C. */
/* */
/* Copyright (C) 2007-2024 */
/* CEA (Commissariat à l'énergie atomique et aux énergies */
/* alternatives) */
/* */
/* you can redistribute it and/or modify it under the terms of the GNU */
/* Lesser General Public License as published by the Free Software */
/* Foundation, version 2.1. */
/* */
/* It is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU Lesser General Public License for more details. */
/* */
/* See the GNU Lesser General Public License version 2.1 */
/* for more details (enclosed in the file licenses/LGPLv2.1). */
/* */
/**************************************************************************/
// glibc-specific, Non-POSIX
#ifndef __FC_SYS_SYSMACROS_H__
#define __FC_SYS_SYSMACROS_H__
// The macros below are useful for coreutils.
#define major(dev) (((dev) >> 8) & 0xff)
#define minor(dev) ((dev) & 0xff)
#define makedev(maj, min) (((maj) << 8) | (min))
#endif
......@@ -50,11 +50,9 @@ typedef unsigned int u_int;
typedef unsigned short u_short;
typedef unsigned char u_char;
// The macros below are non-POSIX; the definitions below should allow
// parsing coreutils.
# define major(dev) (((dev) >> 8) & 0xff)
# define minor(dev) ((dev) & 0xff)
# define makedev(maj, min) (((maj) << 8) | (min))
// Some glibc versions include major/minor/makedev here, but recently
// they are in 'sysmacros.h'
#include "sysmacros.h"
#define __u_char_defined
#endif
......
......@@ -164,6 +164,7 @@
#include "sys/socket.h"
#include "sys/stat.h"
#include "sys/statvfs.h"
#include "sys/sysmacros.h"
#include "sys/time.h"
#include "sys/times.h"
#include "sys/timex.h"
......
......@@ -5,10 +5,10 @@
[eva] Initial state computed
[eva:initial-state] Values of globals at initialization
[eva] fc_libc.c:205: assertion got status valid.
[eva] fc_libc.c:206: assertion got status valid.
[eva] fc_libc.c:207: assertion got status valid.
[eva] fc_libc.c:208: assertion got status valid.
[eva] fc_libc.c:209: assertion got status valid.
[eva] Recording results for main
[eva] Done for function main
[eva] ====== VALUES COMPUTED ======
......
......@@ -129,6 +129,7 @@ skipping FRAMAC_SHARE/libc/complex.h
[kernel] Parsing FRAMAC_SHARE/libc/sys/socket.h (with preprocessing)
[kernel] Parsing FRAMAC_SHARE/libc/sys/stat.h (with preprocessing)
[kernel] Parsing FRAMAC_SHARE/libc/sys/statvfs.h (with preprocessing)
[kernel] Parsing FRAMAC_SHARE/libc/sys/sysmacros.h (with preprocessing)
[kernel] Parsing FRAMAC_SHARE/libc/sys/time.h (with preprocessing)
[kernel] Parsing FRAMAC_SHARE/libc/sys/times.h (with preprocessing)
[kernel] Parsing FRAMAC_SHARE/libc/sys/timex.h (with preprocessing)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment