MFH
Sponsored by: The FreeBSD Foundation
This commit is contained in:
+2
-2
@@ -34,7 +34,8 @@
|
|||||||
* Note that some machines eg. rs6000 have a vfork, but not
|
* Note that some machines eg. rs6000 have a vfork, but not
|
||||||
* with the berkeley semantics, so we cannot use it there either.
|
* with the berkeley semantics, so we cannot use it there either.
|
||||||
*/
|
*/
|
||||||
#define VFORK
|
/* #define VFORK */
|
||||||
|
#define vfork fork
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* BSDJOBS You have BSD-style job control (both process groups and
|
* BSDJOBS You have BSD-style job control (both process groups and
|
||||||
@@ -80,7 +81,6 @@
|
|||||||
/****************** local defines *********************/
|
/****************** local defines *********************/
|
||||||
|
|
||||||
#if defined(__FreeBSD__)
|
#if defined(__FreeBSD__)
|
||||||
#define SAVESIGVEC
|
|
||||||
#define NLS_BUGS
|
#define NLS_BUGS
|
||||||
#define BSD_STYLE_COLORLS
|
#define BSD_STYLE_COLORLS
|
||||||
/* Use LC_MESSAGES locale category to open the message catalog */
|
/* Use LC_MESSAGES locale category to open the message catalog */
|
||||||
|
|||||||
+1
-1
@@ -341,7 +341,7 @@ umaskcmd(int argc __unused, char **argv __unused)
|
|||||||
} else {
|
} else {
|
||||||
void *set;
|
void *set;
|
||||||
INTOFF;
|
INTOFF;
|
||||||
if ((set = setmode (ap)) == 0)
|
if ((set = setmode (ap)) == NULL)
|
||||||
error("Illegal number: %s", ap);
|
error("Illegal number: %s", ap);
|
||||||
|
|
||||||
mask = getmode (set, ~mask & 0777);
|
mask = getmode (set, ~mask & 0777);
|
||||||
|
|||||||
+1
-1
@@ -628,7 +628,7 @@ simplecmd(union node **rpp, union node *redir)
|
|||||||
|
|
||||||
/* If we don't have any redirections already, then we must reset */
|
/* If we don't have any redirections already, then we must reset */
|
||||||
/* rpp to be the address of the local redir variable. */
|
/* rpp to be the address of the local redir variable. */
|
||||||
if (redir == 0)
|
if (redir == NULL)
|
||||||
rpp = &redir;
|
rpp = &redir;
|
||||||
|
|
||||||
args = NULL;
|
args = NULL;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
printf -- '-1-\n'
|
printf -- '-1-\n'
|
||||||
set -- -abc
|
set -- -abc
|
||||||
getopts "ab:" OPTION
|
getopts "ab:" OPTION
|
||||||
echo ${OPTION}
|
printf '%s\n' "${OPTION}"
|
||||||
|
|
||||||
# In this case 'getopts' should realize that we have not provided the
|
# In this case 'getopts' should realize that we have not provided the
|
||||||
# required argument for "-b".
|
# required argument for "-b".
|
||||||
@@ -14,12 +14,12 @@ echo ${OPTION}
|
|||||||
printf -- '-2-\n'
|
printf -- '-2-\n'
|
||||||
set -- -ab
|
set -- -ab
|
||||||
getopts "ab:" OPTION
|
getopts "ab:" OPTION
|
||||||
echo ${OPTION}
|
printf '%s\n' "${OPTION}"
|
||||||
getopts "ab:" OPTION 3>&2 2>&1 >&3 3>&-
|
getopts "ab:" OPTION 3>&2 2>&1 >&3 3>&-
|
||||||
echo ${OPTION}
|
printf '%s\n' "${OPTION}"
|
||||||
|
|
||||||
# The 'shift' is aimed at causing an error.
|
# The 'shift' is aimed at causing an error.
|
||||||
printf -- '-3-\n'
|
printf -- '-3-\n'
|
||||||
shift 1
|
shift 1
|
||||||
getopts "ab:" OPTION
|
getopts "ab:" OPTION
|
||||||
echo ${OPTION}
|
printf '%s\n' "${OPTION}"
|
||||||
|
|||||||
@@ -3,4 +3,4 @@ set - -ax
|
|||||||
getopts ax option
|
getopts ax option
|
||||||
set -C
|
set -C
|
||||||
getopts ax option
|
getopts ax option
|
||||||
echo $option
|
printf '%s\n' "$option"
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
args='-ab'
|
args='-ab'
|
||||||
getopts ab opt $args
|
getopts ab opt $args
|
||||||
echo $?:$opt:$OPTARG
|
printf '%s\n' "$?:$opt:$OPTARG"
|
||||||
for dummy in dummy1 dummy2; do
|
for dummy in dummy1 dummy2; do
|
||||||
getopts ab opt $args
|
getopts ab opt $args
|
||||||
echo $?:$opt:$OPTARG
|
printf '%s\n' "$?:$opt:$OPTARG"
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -50,6 +50,9 @@
|
|||||||
#ifdef illumos
|
#ifdef illumos
|
||||||
#include <libproc.h>
|
#include <libproc.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef __FreeBSD__
|
||||||
|
#include <spawn.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct dtrace_cmd {
|
typedef struct dtrace_cmd {
|
||||||
void (*dc_func)(struct dtrace_cmd *); /* function to compile arg */
|
void (*dc_func)(struct dtrace_cmd *); /* function to compile arg */
|
||||||
@@ -397,7 +400,41 @@ dof_prune(const char *fname)
|
|||||||
free(buf);
|
free(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef illumos
|
#ifdef __FreeBSD__
|
||||||
|
/*
|
||||||
|
* Use nextboot(8) to tell the loader to load DTrace kernel modules during
|
||||||
|
* the next boot of the system. The nextboot(8) configuration is removed during
|
||||||
|
* boot, so it will not persist indefinitely.
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
bootdof_add(void)
|
||||||
|
{
|
||||||
|
char * const nbargv[] = {
|
||||||
|
"nextboot", "-a",
|
||||||
|
"-e", "dtraceall_load=\"YES\"",
|
||||||
|
"-e", "dtrace_dof_load=\"YES\"",
|
||||||
|
"-e", "dtrace_dof_name=\"/boot/dtrace.dof\"",
|
||||||
|
"-e", "dtrace_dof_type=\"dtrace_dof\"",
|
||||||
|
NULL,
|
||||||
|
};
|
||||||
|
pid_t child;
|
||||||
|
int err, status;
|
||||||
|
|
||||||
|
err = posix_spawnp(&child, "nextboot", NULL, NULL, nbargv,
|
||||||
|
NULL);
|
||||||
|
if (err != 0) {
|
||||||
|
error("failed to execute nextboot: %s", strerror(err));
|
||||||
|
exit(E_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (waitpid(child, &status, 0) != child)
|
||||||
|
fatal("waiting for nextboot");
|
||||||
|
if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
|
||||||
|
error("nextboot returned with status %d", status);
|
||||||
|
exit(E_ERROR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
static void
|
static void
|
||||||
etcsystem_prune(void)
|
etcsystem_prune(void)
|
||||||
{
|
{
|
||||||
@@ -508,7 +545,7 @@ etcsystem_add(void)
|
|||||||
|
|
||||||
error("added forceload directives to %s\n", g_ofile);
|
error("added forceload directives to %s\n", g_ofile);
|
||||||
}
|
}
|
||||||
#endif /* illumos */
|
#endif /* !__FreeBSD__ */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_probe_info(const dtrace_probeinfo_t *p)
|
print_probe_info(const dtrace_probeinfo_t *p)
|
||||||
@@ -643,24 +680,24 @@ anon_prog(const dtrace_cmd_t *dcp, dof_hdr_t *dof, int n)
|
|||||||
p = (uchar_t *)dof;
|
p = (uchar_t *)dof;
|
||||||
q = p + dof->dofh_loadsz;
|
q = p + dof->dofh_loadsz;
|
||||||
|
|
||||||
#ifdef illumos
|
#ifdef __FreeBSD__
|
||||||
|
/*
|
||||||
|
* On FreeBSD, the DOF file is read directly during boot - just write
|
||||||
|
* two hex characters per byte.
|
||||||
|
*/
|
||||||
|
oprintf("dof-data-%d=", n);
|
||||||
|
|
||||||
|
while (p < q)
|
||||||
|
oprintf("%02x", *p++);
|
||||||
|
|
||||||
|
oprintf("\n");
|
||||||
|
#else
|
||||||
oprintf("dof-data-%d=0x%x", n, *p++);
|
oprintf("dof-data-%d=0x%x", n, *p++);
|
||||||
|
|
||||||
while (p < q)
|
while (p < q)
|
||||||
oprintf(",0x%x", *p++);
|
oprintf(",0x%x", *p++);
|
||||||
|
|
||||||
oprintf(";\n");
|
oprintf(";\n");
|
||||||
#else
|
|
||||||
/*
|
|
||||||
* On FreeBSD, the DOF data is handled as a kernel environment (kenv)
|
|
||||||
* string. We use two hex characters per DOF byte.
|
|
||||||
*/
|
|
||||||
oprintf("dof-data-%d=%02x", n, *p++);
|
|
||||||
|
|
||||||
while (p < q)
|
|
||||||
oprintf("%02x", *p++);
|
|
||||||
|
|
||||||
oprintf("\n");
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
dtrace_dof_destroy(g_dtp, dof);
|
dtrace_dof_destroy(g_dtp, dof);
|
||||||
@@ -1725,8 +1762,7 @@ main(int argc, char *argv[])
|
|||||||
#else
|
#else
|
||||||
/*
|
/*
|
||||||
* On FreeBSD, anonymous DOF data is written to
|
* On FreeBSD, anonymous DOF data is written to
|
||||||
* the DTrace DOF file that the boot loader will
|
* the DTrace DOF file.
|
||||||
* read if booting with the DTrace option.
|
|
||||||
*/
|
*/
|
||||||
g_ofile = "/boot/dtrace.dof";
|
g_ofile = "/boot/dtrace.dof";
|
||||||
#endif
|
#endif
|
||||||
@@ -1765,7 +1801,10 @@ main(int argc, char *argv[])
|
|||||||
* that itself contains a #pragma D option quiet.
|
* that itself contains a #pragma D option quiet.
|
||||||
*/
|
*/
|
||||||
error("saved anonymous enabling in %s\n", g_ofile);
|
error("saved anonymous enabling in %s\n", g_ofile);
|
||||||
#ifdef illumos
|
|
||||||
|
#ifdef __FreeBSD__
|
||||||
|
bootdof_add();
|
||||||
|
#else
|
||||||
etcsystem_add();
|
etcsystem_add();
|
||||||
error("run update_drv(1M) or reboot to enable changes\n");
|
error("run update_drv(1M) or reboot to enable changes\n");
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -2156,10 +2156,11 @@ dump_label(const char *dev)
|
|||||||
uint64_t psize, ashift;
|
uint64_t psize, ashift;
|
||||||
int len = strlen(dev) + 1;
|
int len = strlen(dev) + 1;
|
||||||
|
|
||||||
if (strncmp(dev, "/dev/dsk/", 9) == 0) {
|
if (strncmp(dev, ZFS_DISK_ROOTD, strlen(ZFS_DISK_ROOTD)) == 0) {
|
||||||
len++;
|
len++;
|
||||||
path = malloc(len);
|
path = malloc(len);
|
||||||
(void) snprintf(path, len, "%s%s", "/dev/rdsk/", dev + 9);
|
(void) snprintf(path, len, "%s%s", ZFS_RDISK_ROOTD,
|
||||||
|
dev + strlen(ZFS_DISK_ROOTD));
|
||||||
} else {
|
} else {
|
||||||
path = strdup(dev);
|
path = strdup(dev);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,12 +21,12 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
|
|
||||||
* Copyright (c) 2011, 2015 by Delphix. All rights reserved.
|
* Copyright (c) 2011, 2015 by Delphix. All rights reserved.
|
||||||
* Copyright (c) 2012 by Frederik Wessels. All rights reserved.
|
* Copyright (c) 2012 by Frederik Wessels. All rights reserved.
|
||||||
* Copyright (c) 2012 Martin Matuska <mm@FreeBSD.org>. All rights reserved.
|
* Copyright (c) 2012 Martin Matuska <mm@FreeBSD.org>. All rights reserved.
|
||||||
* Copyright (c) 2013 by Prasad Joshi (sTec). All rights reserved.
|
* Copyright (c) 2013 by Prasad Joshi (sTec). All rights reserved.
|
||||||
* Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>.
|
* Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>.
|
||||||
|
* Copyright 2016 Nexenta Systems, Inc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <solaris.h>
|
#include <solaris.h>
|
||||||
@@ -626,7 +626,10 @@ zpool_do_remove(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* zpool labelclear <vdev>
|
* zpool labelclear [-f] <vdev>
|
||||||
|
*
|
||||||
|
* -f Force clearing the label for the vdevs which are members of
|
||||||
|
* the exported or foreign pools.
|
||||||
*
|
*
|
||||||
* Verifies that the vdev is not active and zeros out the label information
|
* Verifies that the vdev is not active and zeros out the label information
|
||||||
* on the device.
|
* on the device.
|
||||||
@@ -634,8 +637,11 @@ zpool_do_remove(int argc, char **argv)
|
|||||||
int
|
int
|
||||||
zpool_do_labelclear(int argc, char **argv)
|
zpool_do_labelclear(int argc, char **argv)
|
||||||
{
|
{
|
||||||
char *vdev, *name;
|
char vdev[MAXPATHLEN];
|
||||||
int c, fd = -1, ret = 0;
|
char *name = NULL;
|
||||||
|
struct stat st;
|
||||||
|
int c, fd, ret = 0;
|
||||||
|
nvlist_t *config;
|
||||||
pool_state_t state;
|
pool_state_t state;
|
||||||
boolean_t inuse = B_FALSE;
|
boolean_t inuse = B_FALSE;
|
||||||
boolean_t force = B_FALSE;
|
boolean_t force = B_FALSE;
|
||||||
@@ -658,88 +664,110 @@ zpool_do_labelclear(int argc, char **argv)
|
|||||||
|
|
||||||
/* get vdev name */
|
/* get vdev name */
|
||||||
if (argc < 1) {
|
if (argc < 1) {
|
||||||
(void) fprintf(stderr, gettext("missing vdev device name\n"));
|
(void) fprintf(stderr, gettext("missing vdev name\n"));
|
||||||
|
usage(B_FALSE);
|
||||||
|
}
|
||||||
|
if (argc > 1) {
|
||||||
|
(void) fprintf(stderr, gettext("too many arguments\n"));
|
||||||
usage(B_FALSE);
|
usage(B_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
vdev = argv[0];
|
/*
|
||||||
if ((fd = open(vdev, O_RDWR)) < 0) {
|
* Check if we were given absolute path and use it as is.
|
||||||
(void) fprintf(stderr, gettext("Unable to open %s\n"), vdev);
|
* Otherwise if the provided vdev name doesn't point to a file,
|
||||||
return (B_FALSE);
|
* try prepending dsk path and appending s0.
|
||||||
}
|
*/
|
||||||
|
(void) strlcpy(vdev, argv[0], sizeof (vdev));
|
||||||
|
if (vdev[0] != '/' && stat(vdev, &st) != 0) {
|
||||||
|
char *s;
|
||||||
|
|
||||||
name = NULL;
|
(void) snprintf(vdev, sizeof (vdev), "%s/%s",
|
||||||
if (zpool_in_use(g_zfs, fd, &state, &name, &inuse) != 0) {
|
#ifdef illumos
|
||||||
if (force)
|
ZFS_DISK_ROOT, argv[0]);
|
||||||
goto wipe_label;
|
if ((s = strrchr(argv[0], 's')) == NULL ||
|
||||||
|
!isdigit(*(s + 1)))
|
||||||
(void) fprintf(stderr,
|
(void) strlcat(vdev, "s0", sizeof (vdev));
|
||||||
gettext("Unable to determine pool state for %s\n"
|
#else
|
||||||
"Use -f to force the clearing any label data\n"), vdev);
|
"/dev", argv[0]);
|
||||||
|
#endif
|
||||||
return (1);
|
if (stat(vdev, &st) != 0) {
|
||||||
}
|
(void) fprintf(stderr, gettext(
|
||||||
|
"failed to find device %s, try specifying absolute "
|
||||||
if (inuse) {
|
"path instead\n"), argv[0]);
|
||||||
switch (state) {
|
return (1);
|
||||||
default:
|
|
||||||
case POOL_STATE_ACTIVE:
|
|
||||||
case POOL_STATE_SPARE:
|
|
||||||
case POOL_STATE_L2CACHE:
|
|
||||||
(void) fprintf(stderr,
|
|
||||||
gettext("labelclear operation failed.\n"
|
|
||||||
"\tVdev %s is a member (%s), of pool \"%s\".\n"
|
|
||||||
"\tTo remove label information from this device, export or destroy\n"
|
|
||||||
"\tthe pool, or remove %s from the configuration of this pool\n"
|
|
||||||
"\tand retry the labelclear operation\n"),
|
|
||||||
vdev, zpool_pool_state_to_name(state), name, vdev);
|
|
||||||
ret = 1;
|
|
||||||
goto errout;
|
|
||||||
|
|
||||||
case POOL_STATE_EXPORTED:
|
|
||||||
if (force)
|
|
||||||
break;
|
|
||||||
|
|
||||||
(void) fprintf(stderr,
|
|
||||||
gettext("labelclear operation failed.\n"
|
|
||||||
"\tVdev %s is a member of the exported pool \"%s\".\n"
|
|
||||||
"\tUse \"zpool labelclear -f %s\" to force the removal of label\n"
|
|
||||||
"\tinformation.\n"),
|
|
||||||
vdev, name, vdev);
|
|
||||||
ret = 1;
|
|
||||||
goto errout;
|
|
||||||
|
|
||||||
case POOL_STATE_POTENTIALLY_ACTIVE:
|
|
||||||
if (force)
|
|
||||||
break;
|
|
||||||
|
|
||||||
(void) fprintf(stderr,
|
|
||||||
gettext("labelclear operation failed.\n"
|
|
||||||
"\tVdev %s is a member of the pool \"%s\".\n"
|
|
||||||
"\tThis pool is unknown to this system, but may be active on\n"
|
|
||||||
"\tanother system. Use \'zpool labelclear -f %s\' to force the\n"
|
|
||||||
"\tremoval of label information.\n"),
|
|
||||||
vdev, name, vdev);
|
|
||||||
ret = 1;
|
|
||||||
goto errout;
|
|
||||||
|
|
||||||
case POOL_STATE_DESTROYED:
|
|
||||||
/* inuse should never be set for a destoryed pool... */
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wipe_label:
|
if ((fd = open(vdev, O_RDWR)) < 0) {
|
||||||
if (zpool_clear_label(fd) != 0) {
|
(void) fprintf(stderr, gettext("failed to open %s: %s\n"),
|
||||||
|
vdev, strerror(errno));
|
||||||
|
return (1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (zpool_read_label(fd, &config) != 0 || config == NULL) {
|
||||||
(void) fprintf(stderr,
|
(void) fprintf(stderr,
|
||||||
gettext("Label clear failed on vdev %s\n"), vdev);
|
gettext("failed to read label from %s\n"), vdev);
|
||||||
|
return (1);
|
||||||
|
}
|
||||||
|
nvlist_free(config);
|
||||||
|
|
||||||
|
ret = zpool_in_use(g_zfs, fd, &state, &name, &inuse);
|
||||||
|
if (ret != 0) {
|
||||||
|
(void) fprintf(stderr,
|
||||||
|
gettext("failed to check state for %s\n"), vdev);
|
||||||
|
return (1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!inuse)
|
||||||
|
goto wipe_label;
|
||||||
|
|
||||||
|
switch (state) {
|
||||||
|
default:
|
||||||
|
case POOL_STATE_ACTIVE:
|
||||||
|
case POOL_STATE_SPARE:
|
||||||
|
case POOL_STATE_L2CACHE:
|
||||||
|
(void) fprintf(stderr, gettext(
|
||||||
|
"%s is a member (%s) of pool \"%s\"\n"),
|
||||||
|
vdev, zpool_pool_state_to_name(state), name);
|
||||||
ret = 1;
|
ret = 1;
|
||||||
|
goto errout;
|
||||||
|
|
||||||
|
case POOL_STATE_EXPORTED:
|
||||||
|
if (force)
|
||||||
|
break;
|
||||||
|
(void) fprintf(stderr, gettext(
|
||||||
|
"use '-f' to override the following error:\n"
|
||||||
|
"%s is a member of exported pool \"%s\"\n"),
|
||||||
|
vdev, name);
|
||||||
|
ret = 1;
|
||||||
|
goto errout;
|
||||||
|
|
||||||
|
case POOL_STATE_POTENTIALLY_ACTIVE:
|
||||||
|
if (force)
|
||||||
|
break;
|
||||||
|
(void) fprintf(stderr, gettext(
|
||||||
|
"use '-f' to override the following error:\n"
|
||||||
|
"%s is a member of potentially active pool \"%s\"\n"),
|
||||||
|
vdev, name);
|
||||||
|
ret = 1;
|
||||||
|
goto errout;
|
||||||
|
|
||||||
|
case POOL_STATE_DESTROYED:
|
||||||
|
/* inuse should never be set for a destroyed pool */
|
||||||
|
assert(0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
wipe_label:
|
||||||
|
ret = zpool_clear_label(fd);
|
||||||
|
if (ret != 0) {
|
||||||
|
(void) fprintf(stderr,
|
||||||
|
gettext("failed to clear label for %s\n"), vdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
errout:
|
errout:
|
||||||
close(fd);
|
free(name);
|
||||||
if (name != NULL)
|
(void) close(fd);
|
||||||
free(name);
|
|
||||||
|
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,8 +79,6 @@
|
|||||||
|
|
||||||
#include "zpool_util.h"
|
#include "zpool_util.h"
|
||||||
|
|
||||||
#define DISK_ROOT "/dev/dsk"
|
|
||||||
#define RDISK_ROOT "/dev/rdsk"
|
|
||||||
#define BACKUP_SLICE "s2"
|
#define BACKUP_SLICE "s2"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -384,7 +382,7 @@ is_whole_disk(const char *arg)
|
|||||||
char path[MAXPATHLEN];
|
char path[MAXPATHLEN];
|
||||||
|
|
||||||
(void) snprintf(path, sizeof (path), "%s%s%s",
|
(void) snprintf(path, sizeof (path), "%s%s%s",
|
||||||
RDISK_ROOT, strrchr(arg, '/'), BACKUP_SLICE);
|
ZFS_RDISK_ROOT, strrchr(arg, '/'), BACKUP_SLICE);
|
||||||
if ((fd = open(path, O_RDWR | O_NDELAY)) < 0)
|
if ((fd = open(path, O_RDWR | O_NDELAY)) < 0)
|
||||||
return (B_FALSE);
|
return (B_FALSE);
|
||||||
if (efi_alloc_and_init(fd, EFI_NUMPAR, &label) != 0) {
|
if (efi_alloc_and_init(fd, EFI_NUMPAR, &label) != 0) {
|
||||||
|
|||||||
@@ -20,10 +20,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
|
|
||||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright (c) 2013 by Delphix. All rights reserved.
|
* Copyright (c) 2013 by Delphix. All rights reserved.
|
||||||
* Copyright 2015 RackTop Systems.
|
* Copyright 2015 RackTop Systems.
|
||||||
|
* Copyright 2016 Nexenta Systems, Inc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1099,9 +1099,7 @@ zpool_open_func(void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Given a file descriptor, clear (zero) the label information. This function
|
* Given a file descriptor, clear (zero) the label information.
|
||||||
* is used in the appliance stack as part of the ZFS sysevent module and
|
|
||||||
* to implement the "zpool labelclear" command.
|
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
zpool_clear_label(int fd)
|
zpool_clear_label(int fd)
|
||||||
@@ -1168,7 +1166,7 @@ zpool_find_import_impl(libzfs_handle_t *hdl, importargs_t *iarg)
|
|||||||
*/
|
*/
|
||||||
for (i = 0; i < dirs; i++) {
|
for (i = 0; i < dirs; i++) {
|
||||||
tpool_t *t;
|
tpool_t *t;
|
||||||
char *rdsk;
|
char rdsk[MAXPATHLEN];
|
||||||
int dfd;
|
int dfd;
|
||||||
boolean_t config_failed = B_FALSE;
|
boolean_t config_failed = B_FALSE;
|
||||||
DIR *dirp;
|
DIR *dirp;
|
||||||
@@ -1184,15 +1182,17 @@ zpool_find_import_impl(libzfs_handle_t *hdl, importargs_t *iarg)
|
|||||||
*end = 0;
|
*end = 0;
|
||||||
pathleft = &path[sizeof (path)] - end;
|
pathleft = &path[sizeof (path)] - end;
|
||||||
|
|
||||||
|
#ifdef illumos
|
||||||
/*
|
/*
|
||||||
* Using raw devices instead of block devices when we're
|
* Using raw devices instead of block devices when we're
|
||||||
* reading the labels skips a bunch of slow operations during
|
* reading the labels skips a bunch of slow operations during
|
||||||
* close(2) processing, so we replace /dev/dsk with /dev/rdsk.
|
* close(2) processing, so we replace /dev/dsk with /dev/rdsk.
|
||||||
*/
|
*/
|
||||||
if (strcmp(path, "/dev/dsk/") == 0)
|
if (strcmp(path, ZFS_DISK_ROOTD) == 0)
|
||||||
rdsk = "/dev/";
|
(void) strlcpy(rdsk, ZFS_RDISK_ROOTD, sizeof (rdsk));
|
||||||
else
|
else
|
||||||
rdsk = path;
|
#endif
|
||||||
|
(void) strlcpy(rdsk, path, sizeof (rdsk));
|
||||||
|
|
||||||
if ((dfd = open64(rdsk, O_RDONLY)) < 0 ||
|
if ((dfd = open64(rdsk, O_RDONLY)) < 0 ||
|
||||||
(dirp = fdopendir(dfd)) == NULL) {
|
(dirp = fdopendir(dfd)) == NULL) {
|
||||||
|
|||||||
@@ -20,10 +20,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
|
|
||||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright (c) 2011, 2015 by Delphix. All rights reserved.
|
* Copyright (c) 2011, 2015 by Delphix. All rights reserved.
|
||||||
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
|
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
|
||||||
|
* Copyright 2016 Nexenta Systems, Inc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@@ -49,8 +49,6 @@
|
|||||||
|
|
||||||
static int read_efi_label(nvlist_t *config, diskaddr_t *sb);
|
static int read_efi_label(nvlist_t *config, diskaddr_t *sb);
|
||||||
|
|
||||||
#define DISK_ROOT "/dev/dsk"
|
|
||||||
#define RDISK_ROOT "/dev/rdsk"
|
|
||||||
#define BACKUP_SLICE "s2"
|
#define BACKUP_SLICE "s2"
|
||||||
|
|
||||||
typedef struct prop_flags {
|
typedef struct prop_flags {
|
||||||
@@ -2345,7 +2343,7 @@ zpool_relabel_disk(libzfs_handle_t *hdl, const char *name)
|
|||||||
"efi_use_whole_disk")) == NULL)
|
"efi_use_whole_disk")) == NULL)
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
(void) snprintf(path, sizeof (path), "%s/%s", RDISK_ROOT, name);
|
(void) snprintf(path, sizeof (path), "%s/%s", ZFS_RDISK_ROOT, name);
|
||||||
|
|
||||||
if ((fd = open(path, O_RDWR | O_NDELAY)) < 0) {
|
if ((fd = open(path, O_RDWR | O_NDELAY)) < 0) {
|
||||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "cannot "
|
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "cannot "
|
||||||
@@ -2421,7 +2419,7 @@ zpool_vdev_online(zpool_handle_t *zhp, const char *path, int flags,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (wholedisk) {
|
if (wholedisk) {
|
||||||
pathname += strlen(DISK_ROOT) + 1;
|
pathname += strlen(ZFS_DISK_ROOT) + 1;
|
||||||
(void) zpool_relabel_disk(hdl, pathname);
|
(void) zpool_relabel_disk(hdl, pathname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3411,8 +3409,8 @@ zpool_vdev_name(libzfs_handle_t *hdl, zpool_handle_t *zhp, nvlist_t *nv,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef illumos
|
#ifdef illumos
|
||||||
if (strncmp(path, "/dev/dsk/", 9) == 0)
|
if (strncmp(path, ZFS_DISK_ROOTD, strlen(ZFS_DISK_ROOTD)) == 0)
|
||||||
path += 9;
|
path += strlen(ZFS_DISK_ROOTD);
|
||||||
|
|
||||||
if (nvlist_lookup_uint64(nv, ZPOOL_CONFIG_WHOLE_DISK,
|
if (nvlist_lookup_uint64(nv, ZPOOL_CONFIG_WHOLE_DISK,
|
||||||
&value) == 0 && value) {
|
&value) == 0 && value) {
|
||||||
@@ -3846,7 +3844,7 @@ read_efi_label(nvlist_t *config, diskaddr_t *sb)
|
|||||||
if (nvlist_lookup_string(config, ZPOOL_CONFIG_PATH, &path) != 0)
|
if (nvlist_lookup_string(config, ZPOOL_CONFIG_PATH, &path) != 0)
|
||||||
return (err);
|
return (err);
|
||||||
|
|
||||||
(void) snprintf(diskname, sizeof (diskname), "%s%s", RDISK_ROOT,
|
(void) snprintf(diskname, sizeof (diskname), "%s%s", ZFS_RDISK_ROOT,
|
||||||
strrchr(path, '/'));
|
strrchr(path, '/'));
|
||||||
if ((fd = open(diskname, O_RDONLY|O_NDELAY)) >= 0) {
|
if ((fd = open(diskname, O_RDONLY|O_NDELAY)) >= 0) {
|
||||||
struct dk_gpt *vtoc;
|
struct dk_gpt *vtoc;
|
||||||
@@ -3931,7 +3929,7 @@ zpool_label_disk(libzfs_handle_t *hdl, zpool_handle_t *zhp, const char *name)
|
|||||||
start_block = NEW_START_BLOCK;
|
start_block = NEW_START_BLOCK;
|
||||||
}
|
}
|
||||||
|
|
||||||
(void) snprintf(path, sizeof (path), "%s/%s%s", RDISK_ROOT, name,
|
(void) snprintf(path, sizeof (path), "%s/%s%s", ZFS_RDISK_ROOT, name,
|
||||||
BACKUP_SLICE);
|
BACKUP_SLICE);
|
||||||
|
|
||||||
if ((fd = open(path, O_RDWR | O_NDELAY)) < 0) {
|
if ((fd = open(path, O_RDWR | O_NDELAY)) < 0) {
|
||||||
|
|||||||
@@ -46,9 +46,11 @@ ATF_TC_HEAD(gettimeofday_err, tc)
|
|||||||
ATF_TC_BODY(gettimeofday_err, tc)
|
ATF_TC_BODY(gettimeofday_err, tc)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#ifdef __NetBSD__
|
||||||
errno = 0;
|
errno = 0;
|
||||||
|
|
||||||
ATF_REQUIRE_ERRNO(EFAULT, gettimeofday((void *)-1, NULL) != 0);
|
ATF_REQUIRE_ERRNO(EFAULT, gettimeofday((void *)-1, NULL) != 0);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
ATF_TC(gettimeofday_mono);
|
ATF_TC(gettimeofday_mono);
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
# $FreeBSD$
|
# $FreeBSD$
|
||||||
|
|
||||||
|
CFLAGS+= -DNO_COMPAT7
|
||||||
|
|
||||||
SRCS+= _ctx_start.S \
|
SRCS+= _ctx_start.S \
|
||||||
fabs.S \
|
fabs.S \
|
||||||
flt_rounds.c \
|
flt_rounds.c \
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
# $FreeBSD$
|
# $FreeBSD$
|
||||||
|
|
||||||
|
MIASM:= ${MIASM:Nfreebsd[467]_*}
|
||||||
|
|
||||||
SRCS+= __vdso_gettc.c
|
SRCS+= __vdso_gettc.c
|
||||||
|
|
||||||
#MDASM= ptrace.S
|
#MDASM= ptrace.S
|
||||||
|
|||||||
@@ -423,7 +423,8 @@ hdestroy(HTAB *hashp)
|
|||||||
free(hashp->tmp_buf);
|
free(hashp->tmp_buf);
|
||||||
|
|
||||||
if (hashp->fp != -1) {
|
if (hashp->fp != -1) {
|
||||||
(void)_fsync(hashp->fp);
|
if (hashp->save_file)
|
||||||
|
(void)_fsync(hashp->fp);
|
||||||
(void)_close(hashp->fp);
|
(void)_close(hashp->fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -770,7 +771,7 @@ hash_seq(const DB *dbp, DBT *key, DBT *data, u_int32_t flag)
|
|||||||
if (__big_keydata(hashp, bufp, key, data, 1))
|
if (__big_keydata(hashp, bufp, key, data, 1))
|
||||||
return (ERROR);
|
return (ERROR);
|
||||||
} else {
|
} else {
|
||||||
if (hashp->cpage == 0)
|
if (hashp->cpage == NULL)
|
||||||
return (ERROR);
|
return (ERROR);
|
||||||
key->data = (u_char *)hashp->cpage->page + bp[ndx];
|
key->data = (u_char *)hashp->cpage->page + bp[ndx];
|
||||||
key->size = (ndx > 1 ? bp[ndx - 1] : hashp->BSIZE) - bp[ndx];
|
key->size = (ndx > 1 ? bp[ndx - 1] : hashp->BSIZE) - bp[ndx];
|
||||||
|
|||||||
@@ -245,7 +245,7 @@ newbuf(HTAB *hashp, u_int32_t addr, BUFHEAD *prev_bp)
|
|||||||
*/
|
*/
|
||||||
for (xbp = bp; xbp->ovfl;) {
|
for (xbp = bp; xbp->ovfl;) {
|
||||||
next_xbp = xbp->ovfl;
|
next_xbp = xbp->ovfl;
|
||||||
xbp->ovfl = 0;
|
xbp->ovfl = NULL;
|
||||||
xbp = next_xbp;
|
xbp = next_xbp;
|
||||||
|
|
||||||
/* Check that ovfl pointer is up date. */
|
/* Check that ovfl pointer is up date. */
|
||||||
@@ -350,7 +350,7 @@ __buf_free(HTAB *hashp, int do_free, int to_disk)
|
|||||||
void
|
void
|
||||||
__reclaim_buf(HTAB *hashp, BUFHEAD *bp)
|
__reclaim_buf(HTAB *hashp, BUFHEAD *bp)
|
||||||
{
|
{
|
||||||
bp->ovfl = 0;
|
bp->ovfl = NULL;
|
||||||
bp->addr = 0;
|
bp->addr = 0;
|
||||||
bp->flags = 0;
|
bp->flags = 0;
|
||||||
BUF_REMOVE(bp);
|
BUF_REMOVE(bp);
|
||||||
|
|||||||
+4
-4
@@ -96,7 +96,7 @@ errc(int eval, int code, const char *fmt, ...)
|
|||||||
void
|
void
|
||||||
verrc(int eval, int code, const char *fmt, va_list ap)
|
verrc(int eval, int code, const char *fmt, va_list ap)
|
||||||
{
|
{
|
||||||
if (err_file == 0)
|
if (err_file == NULL)
|
||||||
err_set_file((FILE *)0);
|
err_set_file((FILE *)0);
|
||||||
fprintf(err_file, "%s: ", _getprogname());
|
fprintf(err_file, "%s: ", _getprogname());
|
||||||
if (fmt != NULL) {
|
if (fmt != NULL) {
|
||||||
@@ -121,7 +121,7 @@ errx(int eval, const char *fmt, ...)
|
|||||||
void
|
void
|
||||||
verrx(int eval, const char *fmt, va_list ap)
|
verrx(int eval, const char *fmt, va_list ap)
|
||||||
{
|
{
|
||||||
if (err_file == 0)
|
if (err_file == NULL)
|
||||||
err_set_file((FILE *)0);
|
err_set_file((FILE *)0);
|
||||||
fprintf(err_file, "%s: ", _getprogname());
|
fprintf(err_file, "%s: ", _getprogname());
|
||||||
if (fmt != NULL)
|
if (fmt != NULL)
|
||||||
@@ -161,7 +161,7 @@ warnc(int code, const char *fmt, ...)
|
|||||||
void
|
void
|
||||||
vwarnc(int code, const char *fmt, va_list ap)
|
vwarnc(int code, const char *fmt, va_list ap)
|
||||||
{
|
{
|
||||||
if (err_file == 0)
|
if (err_file == NULL)
|
||||||
err_set_file((FILE *)0);
|
err_set_file((FILE *)0);
|
||||||
fprintf(err_file, "%s: ", _getprogname());
|
fprintf(err_file, "%s: ", _getprogname());
|
||||||
if (fmt != NULL) {
|
if (fmt != NULL) {
|
||||||
@@ -183,7 +183,7 @@ warnx(const char *fmt, ...)
|
|||||||
void
|
void
|
||||||
vwarnx(const char *fmt, va_list ap)
|
vwarnx(const char *fmt, va_list ap)
|
||||||
{
|
{
|
||||||
if (err_file == 0)
|
if (err_file == NULL)
|
||||||
err_set_file((FILE *)0);
|
err_set_file((FILE *)0);
|
||||||
fprintf(err_file, "%s: ", _getprogname());
|
fprintf(err_file, "%s: ", _getprogname());
|
||||||
if (fmt != NULL)
|
if (fmt != NULL)
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ getmntinfo(struct statfs **mntbufp, int flags)
|
|||||||
if (mntbuf)
|
if (mntbuf)
|
||||||
free(mntbuf);
|
free(mntbuf);
|
||||||
bufsize = (mntsize + 1) * sizeof(struct statfs);
|
bufsize = (mntsize + 1) * sizeof(struct statfs);
|
||||||
if ((mntbuf = (struct statfs *)malloc(bufsize)) == 0)
|
if ((mntbuf = malloc(bufsize)) == NULL)
|
||||||
return (0);
|
return (0);
|
||||||
if ((mntsize = getfsstat(mntbuf, bufsize, flags)) < 0)
|
if ((mntsize = getfsstat(mntbuf, bufsize, flags)) < 0)
|
||||||
return (0);
|
return (0);
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ _filldir(DIR *dirp, bool use_current_pos)
|
|||||||
* On the second pass, save pointers to each one.
|
* On the second pass, save pointers to each one.
|
||||||
* Then sort the pointers and remove duplicate names.
|
* Then sort the pointers and remove duplicate names.
|
||||||
*/
|
*/
|
||||||
for (dpv = 0;;) {
|
for (dpv = NULL;;) {
|
||||||
n = 0;
|
n = 0;
|
||||||
ddptr = buf;
|
ddptr = buf;
|
||||||
while (ddptr < ddeptr) {
|
while (ddptr < ddeptr) {
|
||||||
|
|||||||
@@ -29,7 +29,9 @@
|
|||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
|
#ifndef NO_COMPAT7
|
||||||
#define _WANT_SEMUN_OLD
|
#define _WANT_SEMUN_OLD
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/ipc.h>
|
#include <sys/ipc.h>
|
||||||
@@ -38,8 +40,10 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
int __semctl(int semid, int semnum, int cmd, union semun *arg);
|
int __semctl(int semid, int semnum, int cmd, union semun *arg);
|
||||||
|
#ifndef NO_COMPAT7
|
||||||
int freebsd7___semctl(int semid, int semnum, int cmd, union semun_old *arg);
|
int freebsd7___semctl(int semid, int semnum, int cmd, union semun_old *arg);
|
||||||
int freebsd7_semctl(int semid, int semnum, int cmd, ...);
|
int freebsd7_semctl(int semid, int semnum, int cmd, ...);
|
||||||
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
semctl(int semid, int semnum, int cmd, ...)
|
semctl(int semid, int semnum, int cmd, ...)
|
||||||
@@ -61,6 +65,7 @@ semctl(int semid, int semnum, int cmd, ...)
|
|||||||
return (__semctl(semid, semnum, cmd, semun_ptr));
|
return (__semctl(semid, semnum, cmd, semun_ptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NO_COMPAT7
|
||||||
int
|
int
|
||||||
freebsd7_semctl(int semid, int semnum, int cmd, ...)
|
freebsd7_semctl(int semid, int semnum, int cmd, ...)
|
||||||
{
|
{
|
||||||
@@ -82,3 +87,4 @@ freebsd7_semctl(int semid, int semnum, int cmd, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
__sym_compat(semctl, freebsd7_semctl, FBSD_1.0);
|
__sym_compat(semctl, freebsd7_semctl, FBSD_1.0);
|
||||||
|
#endif
|
||||||
|
|||||||
+2
-2
@@ -285,7 +285,7 @@ _init_tls(void)
|
|||||||
while (*sp++ != 0)
|
while (*sp++ != 0)
|
||||||
;
|
;
|
||||||
aux = (Elf_Auxinfo *) sp;
|
aux = (Elf_Auxinfo *) sp;
|
||||||
phdr = 0;
|
phdr = NULL;
|
||||||
phent = phnum = 0;
|
phent = phnum = 0;
|
||||||
for (auxp = aux; auxp->a_type != AT_NULL; auxp++) {
|
for (auxp = aux; auxp->a_type != AT_NULL; auxp++) {
|
||||||
switch (auxp->a_type) {
|
switch (auxp->a_type) {
|
||||||
@@ -302,7 +302,7 @@ _init_tls(void)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (phdr == 0 || phent != sizeof(Elf_Phdr) || phnum == 0)
|
if (phdr == NULL || phent != sizeof(Elf_Phdr) || phnum == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (i = 0; (unsigned) i < phnum; i++) {
|
for (i = 0; (unsigned) i < phnum; i++) {
|
||||||
|
|||||||
@@ -38,9 +38,11 @@
|
|||||||
#define __sym_compat(sym,impl,verid) \
|
#define __sym_compat(sym,impl,verid) \
|
||||||
.symver impl, sym@verid
|
.symver impl, sym@verid
|
||||||
|
|
||||||
|
#ifndef NO_COMPAT7
|
||||||
__sym_compat(__semctl, freebsd7___semctl, FBSD_1.0);
|
__sym_compat(__semctl, freebsd7___semctl, FBSD_1.0);
|
||||||
__sym_compat(msgctl, freebsd7_msgctl, FBSD_1.0);
|
__sym_compat(msgctl, freebsd7_msgctl, FBSD_1.0);
|
||||||
__sym_compat(shmctl, freebsd7_shmctl, FBSD_1.0);
|
__sym_compat(shmctl, freebsd7_shmctl, FBSD_1.0);
|
||||||
|
#endif
|
||||||
|
|
||||||
#undef __sym_compat
|
#undef __sym_compat
|
||||||
|
|
||||||
|
|||||||
@@ -155,12 +155,11 @@ __attribute__((unused)) static void
|
|||||||
xlocale_release(void *val)
|
xlocale_release(void *val)
|
||||||
{
|
{
|
||||||
struct xlocale_refcounted *obj = val;
|
struct xlocale_refcounted *obj = val;
|
||||||
long count = atomic_fetchadd_long(&(obj->retain_count), -1) - 1;
|
long count;
|
||||||
if (count < 0) {
|
|
||||||
if (0 != obj->destructor) {
|
count = atomic_fetchadd_long(&(obj->retain_count), -1) - 1;
|
||||||
obj->destructor(obj);
|
if (count < 0 && obj->destructor != NULL)
|
||||||
}
|
obj->destructor(obj);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ b64_pton(const char *src, u_char *target, size_t targsize)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
pos = strchr(Base64, ch);
|
pos = strchr(Base64, ch);
|
||||||
if (pos == 0) /* A non-base64 character. */
|
if (pos == NULL) /* A non-base64 character. */
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
switch (state) {
|
switch (state) {
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ getifaddrs(struct ifaddrs **pif)
|
|||||||
size_t needed;
|
size_t needed;
|
||||||
char *buf;
|
char *buf;
|
||||||
char *next;
|
char *next;
|
||||||
struct ifaddrs *cif = 0;
|
struct ifaddrs *cif;
|
||||||
char *p, *p0;
|
char *p, *p0;
|
||||||
struct rt_msghdr *rtm;
|
struct rt_msghdr *rtm;
|
||||||
struct if_msghdrl *ifm;
|
struct if_msghdrl *ifm;
|
||||||
@@ -214,6 +214,7 @@ getifaddrs(struct ifaddrs **pif)
|
|||||||
ift = ifa;
|
ift = ifa;
|
||||||
|
|
||||||
idx = 0;
|
idx = 0;
|
||||||
|
cif = NULL;
|
||||||
for (next = buf; next < buf + needed; next += rtm->rtm_msglen) {
|
for (next = buf; next < buf + needed; next += rtm->rtm_msglen) {
|
||||||
rtm = (struct rt_msghdr *)(void *)next;
|
rtm = (struct rt_msghdr *)(void *)next;
|
||||||
if (rtm->rtm_version != RTM_VERSION)
|
if (rtm->rtm_version != RTM_VERSION)
|
||||||
|
|||||||
@@ -406,14 +406,14 @@ files_servent(void *retval, void *mdata, va_list ap)
|
|||||||
|
|
||||||
continue;
|
continue;
|
||||||
gotname:
|
gotname:
|
||||||
if (proto == 0 || strcmp(serv->s_proto, proto) == 0)
|
if (proto == NULL || strcmp(serv->s_proto, proto) == 0)
|
||||||
rv = NS_SUCCESS;
|
rv = NS_SUCCESS;
|
||||||
break;
|
break;
|
||||||
case nss_lt_id:
|
case nss_lt_id:
|
||||||
if (port != serv->s_port)
|
if (port != serv->s_port)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (proto == 0 || strcmp(serv->s_proto, proto) == 0)
|
if (proto == NULL || strcmp(serv->s_proto, proto) == 0)
|
||||||
rv = NS_SUCCESS;
|
rv = NS_SUCCESS;
|
||||||
break;
|
break;
|
||||||
case nss_lt_all:
|
case nss_lt_all:
|
||||||
|
|||||||
+1
-1
@@ -207,7 +207,7 @@ rcmd_af(char **ahost, int rport, const char *locuser, const char *remuser,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
lport--;
|
lport--;
|
||||||
if (fd2p == 0) {
|
if (fd2p == NULL) {
|
||||||
_write(s, "", 1);
|
_write(s, "", 1);
|
||||||
lport = 0;
|
lport = 0;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ static const char *
|
|||||||
format_flag(uint32_t *var, const struct flagnames_struct *flags)
|
format_flag(uint32_t *var, const struct flagnames_struct *flags)
|
||||||
{
|
{
|
||||||
|
|
||||||
for (; flags->name != 0; flags++) {
|
for (; flags->name != NULL; flags++) {
|
||||||
if ((flags->flag & *var) == 0)
|
if ((flags->flag & *var) == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ __res_init_ctx(void) {
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((mt = malloc(sizeof (mtctxres_t))) == 0) {
|
if ((mt = malloc(sizeof(mtctxres_t))) == NULL) {
|
||||||
errno = ENOMEM;
|
errno = ENOMEM;
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
@@ -94,10 +94,7 @@ __res_init_ctx(void) {
|
|||||||
static void
|
static void
|
||||||
__res_destroy_ctx(void *value) {
|
__res_destroy_ctx(void *value) {
|
||||||
|
|
||||||
mtctxres_t *mt = (mtctxres_t *)value;
|
free(value);
|
||||||
|
|
||||||
if (mt != 0)
|
|
||||||
free(mt);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -130,9 +127,9 @@ ___mtctxres(void) {
|
|||||||
* that fails return a global context.
|
* that fails return a global context.
|
||||||
*/
|
*/
|
||||||
if (mt_key_initialized) {
|
if (mt_key_initialized) {
|
||||||
if (((mt = pthread_getspecific(key)) != 0) ||
|
if (((mt = pthread_getspecific(key)) != NULL) ||
|
||||||
(__res_init_ctx() == 0 &&
|
(__res_init_ctx() == 0 &&
|
||||||
(mt = pthread_getspecific(key)) != 0)) {
|
(mt = pthread_getspecific(key)) != NULL)) {
|
||||||
return (mt);
|
return (mt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -315,7 +315,7 @@ __res_vinit(res_state statp, int preinit) {
|
|||||||
while (*cp != '\0' && *cp != ' ' && *cp != '\t' && *cp != '\n')
|
while (*cp != '\0' && *cp != ' ' && *cp != '\t' && *cp != '\n')
|
||||||
cp++;
|
cp++;
|
||||||
*cp = '\0';
|
*cp = '\0';
|
||||||
*pp++ = 0;
|
*pp++ = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MATCH(line, name) \
|
#define MATCH(line, name) \
|
||||||
@@ -391,7 +391,7 @@ __res_vinit(res_state statp, int preinit) {
|
|||||||
while (*cp != '\0' && *cp != ' ' && *cp != '\t')
|
while (*cp != '\0' && *cp != ' ' && *cp != '\t')
|
||||||
cp++;
|
cp++;
|
||||||
*cp = '\0';
|
*cp = '\0';
|
||||||
*pp++ = 0;
|
*pp++ = NULL;
|
||||||
havesearch = 1;
|
havesearch = 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1175,7 +1175,7 @@ res_protocolname(int num) {
|
|||||||
if (protolist == (struct valuelist *)0)
|
if (protolist == (struct valuelist *)0)
|
||||||
res_buildprotolist();
|
res_buildprotolist();
|
||||||
pp = cgetprotobynumber(num);
|
pp = cgetprotobynumber(num);
|
||||||
if (pp == 0) {
|
if (pp == NULL) {
|
||||||
(void) sprintf(number, "%d", num);
|
(void) sprintf(number, "%d", num);
|
||||||
return (number);
|
return (number);
|
||||||
}
|
}
|
||||||
@@ -1190,7 +1190,7 @@ res_servicename(u_int16_t port, const char *proto) { /*%< Host byte order. */
|
|||||||
if (servicelist == (struct valuelist *)0)
|
if (servicelist == (struct valuelist *)0)
|
||||||
res_buildservicelist();
|
res_buildservicelist();
|
||||||
ss = cgetservbyport(htons(port), proto);
|
ss = cgetservbyport(htons(port), proto);
|
||||||
if (ss == 0) {
|
if (ss == NULL) {
|
||||||
(void) sprintf(number, "%d", port);
|
(void) sprintf(number, "%d", port);
|
||||||
return (number);
|
return (number);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,9 +83,9 @@ authnone_create(void)
|
|||||||
XDR *xdrs;
|
XDR *xdrs;
|
||||||
|
|
||||||
mutex_lock(&authnone_lock);
|
mutex_lock(&authnone_lock);
|
||||||
if (ap == 0) {
|
if (ap == NULL) {
|
||||||
ap = (struct authnone_private *)calloc(1, sizeof (*ap));
|
ap = calloc(1, sizeof (*ap));
|
||||||
if (ap == 0) {
|
if (ap == NULL) {
|
||||||
mutex_unlock(&authnone_lock);
|
mutex_unlock(&authnone_lock);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,8 +64,8 @@ static char *
|
|||||||
_buf(void)
|
_buf(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (buf == 0)
|
if (buf == NULL)
|
||||||
buf = (char *)malloc(CLNT_PERROR_BUFLEN);
|
buf = malloc(CLNT_PERROR_BUFLEN);
|
||||||
return (buf);
|
return (buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@ clnt_sperror(CLIENT *rpch, const char *s)
|
|||||||
assert(s != NULL);
|
assert(s != NULL);
|
||||||
|
|
||||||
str = _buf(); /* side effect: sets CLNT_PERROR_BUFLEN */
|
str = _buf(); /* side effect: sets CLNT_PERROR_BUFLEN */
|
||||||
if (str == 0)
|
if (str == NULL)
|
||||||
return (0);
|
return (0);
|
||||||
len = CLNT_PERROR_BUFLEN;
|
len = CLNT_PERROR_BUFLEN;
|
||||||
strstart = str;
|
strstart = str;
|
||||||
@@ -240,7 +240,7 @@ clnt_spcreateerror(const char *s)
|
|||||||
assert(s != NULL);
|
assert(s != NULL);
|
||||||
|
|
||||||
str = _buf(); /* side effect: sets CLNT_PERROR_BUFLEN */
|
str = _buf(); /* side effect: sets CLNT_PERROR_BUFLEN */
|
||||||
if (str == 0)
|
if (str == NULL)
|
||||||
return(0);
|
return(0);
|
||||||
len = CLNT_PERROR_BUFLEN;
|
len = CLNT_PERROR_BUFLEN;
|
||||||
i = snprintf(str, len, "%s: ", s);
|
i = snprintf(str, len, "%s: ", s);
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ rce_key_init(void)
|
|||||||
struct rpc_createerr *
|
struct rpc_createerr *
|
||||||
__rpc_createerr(void)
|
__rpc_createerr(void)
|
||||||
{
|
{
|
||||||
struct rpc_createerr *rce_addr = 0;
|
struct rpc_createerr *rce_addr = NULL;
|
||||||
|
|
||||||
if (thr_main())
|
if (thr_main())
|
||||||
return (&rpc_createerr);
|
return (&rpc_createerr);
|
||||||
|
|||||||
@@ -43,20 +43,20 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "un-namespace.h"
|
#include "un-namespace.h"
|
||||||
|
|
||||||
static char *default_domain = 0;
|
static char *default_domain;
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
get_default_domain(void)
|
get_default_domain(void)
|
||||||
{
|
{
|
||||||
char temp[256];
|
char temp[256];
|
||||||
|
|
||||||
if (default_domain)
|
if (default_domain != NULL)
|
||||||
return (default_domain);
|
return (default_domain);
|
||||||
if (getdomainname(temp, sizeof(temp)) < 0)
|
if (getdomainname(temp, sizeof(temp)) < 0)
|
||||||
return (0);
|
return (0);
|
||||||
if ((int) strlen(temp) > 0) {
|
if ((int) strlen(temp) > 0) {
|
||||||
default_domain = (char *)malloc((strlen(temp)+(unsigned)1));
|
default_domain = malloc((strlen(temp) + (unsigned)1));
|
||||||
if (default_domain == 0)
|
if (default_domain == NULL)
|
||||||
return (0);
|
return (0);
|
||||||
(void) strcpy(default_domain, temp);
|
(void) strcpy(default_domain, temp);
|
||||||
return (default_domain);
|
return (default_domain);
|
||||||
@@ -73,7 +73,7 @@ get_default_domain(void)
|
|||||||
int
|
int
|
||||||
__rpc_get_default_domain(char **domain)
|
__rpc_get_default_domain(char **domain)
|
||||||
{
|
{
|
||||||
if ((*domain = get_default_domain()) != 0)
|
if ((*domain = get_default_domain()) != NULL)
|
||||||
return (0);
|
return (0);
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2068,14 +2068,14 @@ static void
|
|||||||
roundingPrecisionName = "80";
|
roundingPrecisionName = "80";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
roundingPrecisionName = 0;
|
roundingPrecisionName = NULL;
|
||||||
}
|
}
|
||||||
#ifdef FLOATX80
|
#ifdef FLOATX80
|
||||||
floatx80_rounding_precision = roundingPrecision;
|
floatx80_rounding_precision = roundingPrecision;
|
||||||
#endif
|
#endif
|
||||||
switch ( roundingMode ) {
|
switch ( roundingMode ) {
|
||||||
case 0:
|
case 0:
|
||||||
roundingModeName = 0;
|
roundingModeName = NULL;
|
||||||
roundingCode = float_round_nearest_even;
|
roundingCode = float_round_nearest_even;
|
||||||
break;
|
break;
|
||||||
case ROUND_NEAREST_EVEN:
|
case ROUND_NEAREST_EVEN:
|
||||||
@@ -2098,7 +2098,7 @@ static void
|
|||||||
float_rounding_mode = roundingCode;
|
float_rounding_mode = roundingCode;
|
||||||
switch ( tininessMode ) {
|
switch ( tininessMode ) {
|
||||||
case 0:
|
case 0:
|
||||||
tininessModeName = 0;
|
tininessModeName = NULL;
|
||||||
tininessCode = float_tininess_after_rounding;
|
tininessCode = float_tininess_after_rounding;
|
||||||
break;
|
break;
|
||||||
case TININESS_BEFORE_ROUNDING:
|
case TININESS_BEFORE_ROUNDING:
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ uuid_to_string(const uuid_t *u, char **s, uint32_t *status)
|
|||||||
*status = uuid_s_ok;
|
*status = uuid_s_ok;
|
||||||
|
|
||||||
/* Why allow a NULL-pointer here? */
|
/* Why allow a NULL-pointer here? */
|
||||||
if (s == 0)
|
if (s == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (u == NULL) {
|
if (u == NULL) {
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ xdrmem_setpos(XDR *xdrs, u_int pos)
|
|||||||
static int32_t *
|
static int32_t *
|
||||||
xdrmem_inline_aligned(XDR *xdrs, u_int len)
|
xdrmem_inline_aligned(XDR *xdrs, u_int len)
|
||||||
{
|
{
|
||||||
int32_t *buf = 0;
|
int32_t *buf = NULL;
|
||||||
|
|
||||||
if (xdrs->x_handy >= len) {
|
if (xdrs->x_handy >= len) {
|
||||||
xdrs->x_handy -= len;
|
xdrs->x_handy -= len;
|
||||||
|
|||||||
@@ -471,7 +471,7 @@ fn_complete(EditLine *el,
|
|||||||
|
|
||||||
/* these can be used by function called in completion_matches() */
|
/* these can be used by function called in completion_matches() */
|
||||||
/* or (*attempted_completion_function)() */
|
/* or (*attempted_completion_function)() */
|
||||||
if (point != 0)
|
if (point != NULL)
|
||||||
*point = (int)(li->cursor - li->buffer);
|
*point = (int)(li->cursor - li->buffer);
|
||||||
if (end != NULL)
|
if (end != NULL)
|
||||||
*end = (int)(li->lastchar - li->buffer);
|
*end = (int)(li->lastchar - li->buffer);
|
||||||
@@ -483,7 +483,7 @@ fn_complete(EditLine *el,
|
|||||||
&el->el_scratch),
|
&el->el_scratch),
|
||||||
cur_off - (int)len, cur_off);
|
cur_off - (int)len, cur_off);
|
||||||
} else
|
} else
|
||||||
matches = 0;
|
matches = NULL;
|
||||||
if (!attempted_completion_function ||
|
if (!attempted_completion_function ||
|
||||||
(over != NULL && !*over && !matches))
|
(over != NULL && !*over && !matches))
|
||||||
matches = completion_matches(
|
matches = completion_matches(
|
||||||
|
|||||||
+2
-2
@@ -1088,7 +1088,7 @@ vi_history_word(EditLine *el, Int c __attribute__((__unused__)))
|
|||||||
if (wp == NULL)
|
if (wp == NULL)
|
||||||
return CC_ERROR;
|
return CC_ERROR;
|
||||||
|
|
||||||
wep = wsp = 0;
|
wep = wsp = NULL;
|
||||||
do {
|
do {
|
||||||
while (Isspace(*wp))
|
while (Isspace(*wp))
|
||||||
wp++;
|
wp++;
|
||||||
@@ -1101,7 +1101,7 @@ vi_history_word(EditLine *el, Int c __attribute__((__unused__)))
|
|||||||
} while ((!el->el_state.doingarg || --el->el_state.argument > 0)
|
} while ((!el->el_state.doingarg || --el->el_state.argument > 0)
|
||||||
&& *wp != 0);
|
&& *wp != 0);
|
||||||
|
|
||||||
if (wsp == 0 || (el->el_state.doingarg && el->el_state.argument != 0))
|
if (wsp == NULL || (el->el_state.doingarg && el->el_state.argument != 0))
|
||||||
return CC_ERROR;
|
return CC_ERROR;
|
||||||
|
|
||||||
cv_undo(el);
|
cv_undo(el);
|
||||||
|
|||||||
+1
-1
@@ -929,7 +929,7 @@ ftp_authenticate(conn_t *conn, struct url *url, struct url *purl)
|
|||||||
if (*pwd == '\0')
|
if (*pwd == '\0')
|
||||||
pwd = getenv("FTP_PASSWORD");
|
pwd = getenv("FTP_PASSWORD");
|
||||||
if (pwd == NULL || *pwd == '\0') {
|
if (pwd == NULL || *pwd == '\0') {
|
||||||
if ((logname = getlogin()) == 0)
|
if ((logname = getlogin()) == NULL)
|
||||||
logname = FTP_ANONYMOUS_USER;
|
logname = FTP_ANONYMOUS_USER;
|
||||||
if ((len = snprintf(pbuf, MAXLOGNAME + 1, "%s@", logname)) < 0)
|
if ((len = snprintf(pbuf, MAXLOGNAME + 1, "%s@", logname)) < 0)
|
||||||
len = 0;
|
len = 0;
|
||||||
|
|||||||
@@ -860,7 +860,7 @@ verify_krb_v5_tgt(krb5_context context, krb5_ccache ccache,
|
|||||||
services[0] = "host";
|
services[0] = "host";
|
||||||
services[1] = pam_service;
|
services[1] = pam_service;
|
||||||
services[2] = NULL;
|
services[2] = NULL;
|
||||||
keyblock = 0;
|
keyblock = NULL;
|
||||||
retval = -1;
|
retval = -1;
|
||||||
for (service = &services[0]; *service != NULL; service++) {
|
for (service = &services[0]; *service != NULL; service++) {
|
||||||
retval = krb5_sname_to_principal(context, NULL, *service,
|
retval = krb5_sname_to_principal(context, NULL, *service,
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ list_match(char *list, const char *item,
|
|||||||
* the match is affected by any exceptions.
|
* the match is affected by any exceptions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for (tok = strtok(list, sep); tok != 0; tok = strtok((char *) 0, sep)) {
|
for (tok = strtok(list, sep); tok != NULL; tok = strtok((char *) 0, sep)) {
|
||||||
if (strcasecmp(tok, "EXCEPT") == 0) /* EXCEPT: give up */
|
if (strcasecmp(tok, "EXCEPT") == 0) /* EXCEPT: give up */
|
||||||
break;
|
break;
|
||||||
if ((match = (*match_fn)(tok, item)) != 0) /* YES */
|
if ((match = (*match_fn)(tok, item)) != 0) /* YES */
|
||||||
@@ -135,7 +135,7 @@ list_match(char *list, const char *item,
|
|||||||
if (match != NO) {
|
if (match != NO) {
|
||||||
while ((tok = strtok((char *) 0, sep)) && strcasecmp(tok, "EXCEPT"))
|
while ((tok = strtok((char *) 0, sep)) && strcasecmp(tok, "EXCEPT"))
|
||||||
/* VOID */ ;
|
/* VOID */ ;
|
||||||
if (tok == 0 || list_match((char *) 0, item, match_fn) == NO)
|
if (tok == NULL || list_match((char *) 0, item, match_fn) == NO)
|
||||||
return (match);
|
return (match);
|
||||||
}
|
}
|
||||||
return (NO);
|
return (NO);
|
||||||
|
|||||||
@@ -22,11 +22,11 @@
|
|||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <pthread_np.h>
|
#include <pthread_np.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
|||||||
@@ -89,10 +89,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|||||||
@@ -29,10 +29,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|
||||||
#include "thr_private.h"
|
#include "thr_private.h"
|
||||||
|
|||||||
@@ -22,10 +22,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -34,6 +35,9 @@
|
|||||||
|
|
||||||
#include "thr_private.h"
|
#include "thr_private.h"
|
||||||
|
|
||||||
|
_Static_assert(sizeof(struct pthread_barrier) <= PAGE_SIZE,
|
||||||
|
"pthread_barrier is too large for off-page");
|
||||||
|
|
||||||
__weak_reference(_pthread_barrier_init, pthread_barrier_init);
|
__weak_reference(_pthread_barrier_init, pthread_barrier_init);
|
||||||
__weak_reference(_pthread_barrier_wait, pthread_barrier_wait);
|
__weak_reference(_pthread_barrier_wait, pthread_barrier_wait);
|
||||||
__weak_reference(_pthread_barrier_destroy, pthread_barrier_destroy);
|
__weak_reference(_pthread_barrier_destroy, pthread_barrier_destroy);
|
||||||
|
|||||||
@@ -24,10 +24,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||||
* DAMAGE.
|
* DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|||||||
@@ -22,11 +22,11 @@
|
|||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include "un-namespace.h"
|
#include "un-namespace.h"
|
||||||
|
|||||||
@@ -25,10 +25,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|||||||
@@ -28,10 +28,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|||||||
@@ -26,10 +26,11 @@
|
|||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@@ -40,6 +41,9 @@
|
|||||||
|
|
||||||
#include "thr_private.h"
|
#include "thr_private.h"
|
||||||
|
|
||||||
|
_Static_assert(sizeof(struct pthread_cond) <= PAGE_SIZE,
|
||||||
|
"pthread_cond too large");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Prototypes
|
* Prototypes
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -25,10 +25,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|||||||
@@ -23,10 +23,11 @@
|
|||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/rtprio.h>
|
#include <sys/rtprio.h>
|
||||||
|
|||||||
@@ -23,11 +23,11 @@
|
|||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|||||||
@@ -25,9 +25,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include "un-namespace.h"
|
#include "un-namespace.h"
|
||||||
|
|||||||
@@ -22,10 +22,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "thr_private.h"
|
#include "thr_private.h"
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -25,10 +25,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#ifdef _PTHREAD_FORCED_UNWIND
|
#ifdef _PTHREAD_FORCED_UNWIND
|
||||||
|
|||||||
@@ -23,8 +23,6 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -57,6 +55,9 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include <sys/syscall.h>
|
#include <sys/syscall.h>
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|||||||
@@ -22,10 +22,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|||||||
@@ -25,9 +25,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|||||||
@@ -28,10 +28,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/rtprio.h>
|
#include <sys/rtprio.h>
|
||||||
|
|||||||
@@ -21,10 +21,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <pthread_np.h>
|
#include <pthread_np.h>
|
||||||
|
|||||||
@@ -25,10 +25,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|||||||
@@ -29,10 +29,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/signalvar.h>
|
#include <sys/signalvar.h>
|
||||||
|
|||||||
@@ -22,11 +22,11 @@
|
|||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|||||||
@@ -23,10 +23,11 @@
|
|||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/signalvar.h>
|
#include <sys/signalvar.h>
|
||||||
#include <sys/rtprio.h>
|
#include <sys/rtprio.h>
|
||||||
|
|||||||
@@ -25,10 +25,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|||||||
@@ -23,10 +23,11 @@
|
|||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/queue.h>
|
#include <sys/queue.h>
|
||||||
|
|
||||||
|
|||||||
@@ -23,10 +23,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <pthread_np.h>
|
#include <pthread_np.h>
|
||||||
@@ -37,10 +38,10 @@
|
|||||||
__weak_reference(_pthread_main_np, pthread_main_np);
|
__weak_reference(_pthread_main_np, pthread_main_np);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Provide the equivelant to Solaris thr_main() function
|
* Provide the equivalent to Solaris thr_main() function.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
_pthread_main_np()
|
_pthread_main_np(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!_thr_initial)
|
if (!_thr_initial)
|
||||||
|
|||||||
@@ -25,10 +25,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <pthread_np.h>
|
#include <pthread_np.h>
|
||||||
@@ -37,7 +38,7 @@
|
|||||||
__weak_reference(_pthread_multi_np, pthread_multi_np);
|
__weak_reference(_pthread_multi_np, pthread_multi_np);
|
||||||
|
|
||||||
int
|
int
|
||||||
_pthread_multi_np()
|
_pthread_multi_np(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* Return to multi-threaded scheduling mode: */
|
/* Return to multi-threaded scheduling mode: */
|
||||||
|
|||||||
@@ -34,10 +34,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -51,6 +52,9 @@
|
|||||||
|
|
||||||
#include "thr_private.h"
|
#include "thr_private.h"
|
||||||
|
|
||||||
|
_Static_assert(sizeof(struct pthread_mutex) <= PAGE_SIZE,
|
||||||
|
"pthread_mutex is too large for off-page");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For adaptive mutexes, how many times to spin doing trylock2
|
* For adaptive mutexes, how many times to spin doing trylock2
|
||||||
* before entering the kernel to block
|
* before entering the kernel to block
|
||||||
|
|||||||
@@ -25,8 +25,6 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -59,6 +57,9 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|||||||
@@ -22,11 +22,11 @@
|
|||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include "un-namespace.h"
|
#include "un-namespace.h"
|
||||||
|
|||||||
@@ -22,10 +22,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|||||||
@@ -26,10 +26,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -38,6 +39,9 @@
|
|||||||
|
|
||||||
#include "thr_private.h"
|
#include "thr_private.h"
|
||||||
|
|
||||||
|
_Static_assert(sizeof(struct pthread_spinlock) <= PAGE_SIZE,
|
||||||
|
"pthread_spinlock is too large for off-page");
|
||||||
|
|
||||||
#define SPIN_COUNT 100000
|
#define SPIN_COUNT 100000
|
||||||
|
|
||||||
__weak_reference(_pthread_spin_init, pthread_spin_init);
|
__weak_reference(_pthread_spin_init, pthread_spin_init);
|
||||||
|
|||||||
@@ -25,10 +25,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|||||||
@@ -22,11 +22,11 @@
|
|||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A lockless rwlock for rtld.
|
* A lockless rwlock for rtld.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -22,10 +22,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -35,6 +36,9 @@
|
|||||||
#include "un-namespace.h"
|
#include "un-namespace.h"
|
||||||
#include "thr_private.h"
|
#include "thr_private.h"
|
||||||
|
|
||||||
|
_Static_assert(sizeof(struct pthread_rwlock) <= PAGE_SIZE,
|
||||||
|
"pthread_rwlock is too large for off-page");
|
||||||
|
|
||||||
__weak_reference(_pthread_rwlock_destroy, pthread_rwlock_destroy);
|
__weak_reference(_pthread_rwlock_destroy, pthread_rwlock_destroy);
|
||||||
__weak_reference(_pthread_rwlock_init, pthread_rwlock_init);
|
__weak_reference(_pthread_rwlock_init, pthread_rwlock_init);
|
||||||
__weak_reference(_pthread_rwlock_rdlock, pthread_rwlock_rdlock);
|
__weak_reference(_pthread_rwlock_rdlock, pthread_rwlock_rdlock);
|
||||||
|
|||||||
@@ -22,10 +22,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|||||||
@@ -25,10 +25,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include "un-namespace.h"
|
#include "un-namespace.h"
|
||||||
|
|||||||
@@ -26,10 +26,11 @@
|
|||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/queue.h>
|
#include <sys/queue.h>
|
||||||
|
|||||||
@@ -25,10 +25,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include "un-namespace.h"
|
#include "un-namespace.h"
|
||||||
|
|||||||
@@ -28,10 +28,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|||||||
@@ -22,10 +22,11 @@
|
|||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|||||||
@@ -25,10 +25,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <pthread_np.h>
|
#include <pthread_np.h>
|
||||||
@@ -36,7 +37,8 @@
|
|||||||
|
|
||||||
__weak_reference(_pthread_single_np, pthread_single_np);
|
__weak_reference(_pthread_single_np, pthread_single_np);
|
||||||
|
|
||||||
int _pthread_single_np()
|
int
|
||||||
|
_pthread_single_np(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* Enter single-threaded (non-POSIX) scheduling mode: */
|
/* Enter single-threaded (non-POSIX) scheduling mode: */
|
||||||
|
|||||||
@@ -22,10 +22,11 @@
|
|||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "thr_private.h"
|
#include "thr_private.h"
|
||||||
|
|
||||||
|
|||||||
@@ -25,10 +25,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|||||||
@@ -25,11 +25,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <libc_private.h>
|
#include <libc_private.h>
|
||||||
|
|||||||
@@ -23,10 +23,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <sys/queue.h>
|
#include <sys/queue.h>
|
||||||
|
|||||||
@@ -25,10 +25,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|||||||
@@ -28,10 +28,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|||||||
@@ -25,10 +25,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|||||||
@@ -22,11 +22,11 @@
|
|||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "thr_private.h"
|
#include "thr_private.h"
|
||||||
#include "thr_umtx.h"
|
#include "thr_umtx.h"
|
||||||
|
|
||||||
|
|||||||
@@ -25,10 +25,11 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
|
||||||
* $FreeBSD$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include "namespace.h"
|
#include "namespace.h"
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
|
|||||||
@@ -139,8 +139,8 @@ libusb20_tr_close(struct libusb20_transfer *xfer)
|
|||||||
free(xfer->ppBuffer);
|
free(xfer->ppBuffer);
|
||||||
}
|
}
|
||||||
/* reset variable fields in case the transfer is opened again */
|
/* reset variable fields in case the transfer is opened again */
|
||||||
xfer->priv_sc0 = 0;
|
xfer->priv_sc0 = NULL;
|
||||||
xfer->priv_sc1 = 0;
|
xfer->priv_sc1 = NULL;
|
||||||
xfer->is_opened = 0;
|
xfer->is_opened = 0;
|
||||||
xfer->is_pending = 0;
|
xfer->is_pending = 0;
|
||||||
xfer->is_cancel = 0;
|
xfer->is_cancel = 0;
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ hid_use_report_desc(unsigned char *data, unsigned int size)
|
|||||||
report_desc_t r;
|
report_desc_t r;
|
||||||
|
|
||||||
r = malloc(sizeof(*r) + size);
|
r = malloc(sizeof(*r) + size);
|
||||||
if (r == 0) {
|
if (r == NULL) {
|
||||||
errno = ENOMEM;
|
errno = ENOMEM;
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,9 +77,9 @@ hid_init(const char *hidname)
|
|||||||
char line[100], name[100], *p, *n;
|
char line[100], name[100], *p, *n;
|
||||||
int no;
|
int no;
|
||||||
int lineno;
|
int lineno;
|
||||||
struct usage_page *curpage = 0;
|
struct usage_page *curpage = NULL;
|
||||||
|
|
||||||
if (hidname == 0)
|
if (hidname == NULL)
|
||||||
hidname = _PATH_HIDTABLE;
|
hidname = _PATH_HIDTABLE;
|
||||||
|
|
||||||
f = fopen(hidname, "r");
|
f = fopen(hidname, "r");
|
||||||
@@ -124,7 +124,7 @@ hid_init(const char *hidname)
|
|||||||
curpage->pagesize++;
|
curpage->pagesize++;
|
||||||
} else {
|
} else {
|
||||||
if (npages >= npagesmax) {
|
if (npages >= npagesmax) {
|
||||||
if (pages == 0) {
|
if (pages == NULL) {
|
||||||
npagesmax = 5;
|
npagesmax = 5;
|
||||||
pages = malloc(npagesmax *
|
pages = malloc(npagesmax *
|
||||||
sizeof (struct usage_page));
|
sizeof (struct usage_page));
|
||||||
|
|||||||
@@ -925,6 +925,7 @@ int
|
|||||||
reconnect(int dosfs, struct bootblock *boot, struct fatEntry *fat, cl_t head)
|
reconnect(int dosfs, struct bootblock *boot, struct fatEntry *fat, cl_t head)
|
||||||
{
|
{
|
||||||
struct dosDirEntry d;
|
struct dosDirEntry d;
|
||||||
|
int len;
|
||||||
u_char *p;
|
u_char *p;
|
||||||
|
|
||||||
if (!ask(1, "Reconnect"))
|
if (!ask(1, "Reconnect"))
|
||||||
@@ -976,14 +977,15 @@ reconnect(int dosfs, struct bootblock *boot, struct fatEntry *fat, cl_t head)
|
|||||||
boot->NumFiles++;
|
boot->NumFiles++;
|
||||||
/* Ensure uniqueness of entry here! XXX */
|
/* Ensure uniqueness of entry here! XXX */
|
||||||
memset(&d, 0, sizeof d);
|
memset(&d, 0, sizeof d);
|
||||||
(void)snprintf(d.name, sizeof(d.name), "%u", head);
|
/* worst case -1 = 4294967295, 10 digits */
|
||||||
|
len = snprintf(d.name, sizeof(d.name), "%u", head);
|
||||||
d.flags = 0;
|
d.flags = 0;
|
||||||
d.head = head;
|
d.head = head;
|
||||||
d.size = fat[head].length * boot->ClusterSize;
|
d.size = fat[head].length * boot->ClusterSize;
|
||||||
|
|
||||||
memset(p, 0, 32);
|
memcpy(p, d.name, len);
|
||||||
memset(p, ' ', 11);
|
memset(p + len, ' ', 11 - len);
|
||||||
memcpy(p, d.name, strlen(d.name));
|
memset(p + 11, 0, 32 - 11);
|
||||||
p[26] = (u_char)d.head;
|
p[26] = (u_char)d.head;
|
||||||
p[27] = (u_char)(d.head >> 8);
|
p[27] = (u_char)(d.head >> 8);
|
||||||
if (boot->ClustMask == CLUST32_MASK) {
|
if (boot->ClustMask == CLUST32_MASK) {
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user