2 * Copyright 2017 Lauri Tirkkonen <lotheac@iki.fi>
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 #include <sys/syscall.h>
21 #include <sys/utsname.h>
22 #include <sys/cfgparam.h>
25 uname(struct utsname
*name
)
27 int ret
= syscall(SYS_uname
, name
);
29 if (ret
>= 0 && getenv("UNAME_LEGACY")) {
30 strlcpy(name
->sysname
, "SunOS", sizeof(name
->sysname
));
31 strlcpy(name
->release
, "5.11", sizeof(name
->release
));
32 strlcpy(name
->version
, "legacy-uname", sizeof(name
->version
));
33 strlcpy(name
->machine
, CONFIG_PLATFORM_STR
,
34 sizeof(name
->machine
));
39 /* binary compat alias */
40 #pragma weak _nuname = uname