xref: /titanic_51/usr/src/test/libc-tests/cfg/symbols/README (revision dcdfe824b3dff2df12578b936adf1daf000aa129)
1de572d98SGarrett D'Amore#
2de572d98SGarrett D'Amore# This file and its contents are supplied under the terms of the
3de572d98SGarrett D'Amore# Common Development and Distribution License ("CDDL"), version 1.0.
4de572d98SGarrett D'Amore# You may only use this file in accordance with the terms of version
5de572d98SGarrett D'Amore# 1.0 of the CDDL.
6de572d98SGarrett D'Amore#
7de572d98SGarrett D'Amore# A full copy of the text of the CDDL should have accompanied this
8de572d98SGarrett D'Amore# source.  A copy of the CDDL is also available via the Internet at
9de572d98SGarrett D'Amore# http://www.illumos.org/license/CDDL.
10de572d98SGarrett D'Amore#
11de572d98SGarrett D'Amore
12de572d98SGarrett D'Amore#
13de572d98SGarrett D'Amore# Copyright 2015 Garrett D'Amore <garrett@damore.org>
14*dcdfe824SRobert Mustacchi# Copyright 2016 Joyent, Inc.
15de572d98SGarrett D'Amore#
16de572d98SGarrett D'Amore
17de572d98SGarrett D'AmoreThe configuration files in this directory are structured using the
18de572d98SGarrett D'Amoresyntax defined in the ../README file.  They make use of the compilation
19de572d98SGarrett D'Amoreenvironments declared in ../compilation.cfg, and are processed by the
20de572d98SGarrett D'Amoresymbols test.
21de572d98SGarrett D'Amore
22de572d98SGarrett D'AmoreWe have organized the files by header file, that is the tests for symbols
23de572d98SGarrett D'Amoredeclared in a header file (e.g. <unistd.h> appear in a file based on that
24de572d98SGarrett D'Amoreheader file's name (e.g. unistd_h.cfg.)  This is purely for convenience.
25de572d98SGarrett D'Amore
26de572d98SGarrett D'AmoreWithin these various declarations, we have the following field types:
27de572d98SGarrett D'Amore
28de572d98SGarrett D'Amore<envs>    This is a list of compilation environments where the symbol
29de572d98SGarrett D'Amore          should be legal.  To indicate that the symbol must not be legal
30de572d98SGarrett D'Amore          an environment group can be prefixed with "-".  For example,
31de572d98SGarrett D'Amore          "SUS+ -SUSv4+" indicates a symbol that is legal in all SUS
32de572d98SGarrett D'Amore	  environments up to SUSv3, and was removed in SUSv4 and subsequent
33de572d98SGarrett D'Amore          versions of SUS.  As you can see, we can list multiple environments
34de572d98SGarrett D'Amore          or environment groups, and we can add or remove to previous groups
35de572d98SGarrett D'Amore          with subsequent ones.
36de572d98SGarrett D'Amore
37de572d98SGarrett D'Amore<name>    This is a symbol name.  It follows the rules for C symbol names.
38de572d98SGarrett D'Amore
39de572d98SGarrett D'Amore<header>  This is a header file, for example, unistd.h.  Conventionally,
40de572d98SGarrett D'Amore          the header files used should match the file where the test is
41de572d98SGarrett D'Amore          declared.
42de572d98SGarrett D'Amore
43de572d98SGarrett D'Amore<type>    This is a C type.  Function types can be declared without their
44de572d98SGarrett D'Amore          names, e.g. "void (*)(int)".  Structures (e.g. "struct stat") and
45de572d98SGarrett D'Amore          pointer types (e.g. "pthead_t *") are legal as well.
46de572d98SGarrett D'Amore
47de572d98SGarrett D'AmoreHere are the types of declarations in these files:
48de572d98SGarrett D'Amore
49de572d98SGarrett D'Amoretype | <name> | <header> | <envs>
50de572d98SGarrett D'Amore
51de572d98SGarrett D'Amore    Tests for a C type with <name>.  The test verifies that a variable with
52de572d98SGarrett D'Amore    this type can be declared when the <header> is included.
53de572d98SGarrett D'Amore
54de572d98SGarrett D'Amorevalue | <name> | <type> | <header> | <envs>
55de572d98SGarrett D'Amore
56de572d98SGarrett D'Amore    Tests for a value named <name>, of type <type>.  The test attempts to
57de572d98SGarrett D'Amore    assign the given value to a scratch variable declared with the given
58de572d98SGarrett D'Amore    type.  The value can be a macro or other C symbol.
59de572d98SGarrett D'Amore
60*dcdfe824SRobert Mustacchidefine | <name> | <value> | <header> | <envs>
61*dcdfe824SRobert Mustacchi
62*dcdfe824SRobert Mustacchi    Tests for a definition named <name>.  The test verifies that the
63*dcdfe824SRobert Mustacchi    pre-processor sees the definition.  If the <value> entry is not
64*dcdfe824SRobert Mustacchi    empty then the check also verifies that there is strict equality
65*dcdfe824SRobert Mustacchi    between the pre-processor value and it.  Only strict equality checks
66*dcdfe824SRobert Mustacchi    are supported at this time.
67*dcdfe824SRobert Mustacchi
68de572d98SGarrett D'Amorefunc | <name> | <type> | <type> [; <type> ]... | <header> | <envs>
69de572d98SGarrett D'Amore
70de572d98SGarrett D'Amore    Tests whether a function <name>, returning the first <type>, and
71de572d98SGarrett D'Amore    taking arguments of following <type> values, is declared.  Note that
72de572d98SGarrett D'Amore    the argument types are separated by semicolons.  For varargs style
73de572d98SGarrett D'Amore    functions, leave out the ... part.  For function declarations
74de572d98SGarrett D'Amore    that have no declared arguments, either void can specified, or
75de572d98SGarrett D'Amore    the type list can be omitted.
76de572d98SGarrett D'Amore
77de572d98SGarrett D'AmoreExamples:
78de572d98SGarrett D'Amore
79de572d98SGarrett D'Amore    type | size_t | sys/types.h | ALL
80de572d98SGarrett D'Amore    value | NULL | void * | stdlib.h | ALL
81*dcdfe824SRobert Mustacchi    define | thread_local | | threads.h | -ALL +C11
82*dcdfe824SRobert Mustacchi    define | __alignas_is_defined | 1 | threads.h | -ALL +C11
83*dcdfe824SRobert Mustacchi    func | strnlen | int | const char *; int | string.h | ALL
84