Revert crap accidentally committed
This commit is contained in:
parent
814aaaa7da
commit
b4b4b5304b
@ -9,7 +9,7 @@ LINKS= ${BINDIR}/ed ${BINDIR}/red
|
|||||||
MLINKS= ed.1 red.1
|
MLINKS= ed.1 red.1
|
||||||
|
|
||||||
.if ${MK_OPENSSL} != "no" && ${MK_ED_CRYPTO} != "no"
|
.if ${MK_OPENSSL} != "no" && ${MK_ED_CRYPTO} != "no"
|
||||||
CFLAGS+=-DDES -I/usr/include/private/openssl
|
CFLAGS+=-DDES
|
||||||
LIBADD= crypto
|
LIBADD= crypto
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
@ -38,7 +38,6 @@
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <ctype.h>
|
|
||||||
|
|
||||||
#include "dma.h"
|
#include "dma.h"
|
||||||
|
|
||||||
@ -342,41 +341,18 @@ parse_addrs(struct parse_state *ps, char *s, struct queue *queue)
|
|||||||
goto again;
|
goto again;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
writeline(struct queue *queue, const char *line, ssize_t linelen)
|
|
||||||
{
|
|
||||||
ssize_t len;
|
|
||||||
|
|
||||||
while (linelen > 0) {
|
|
||||||
len = linelen;
|
|
||||||
if (linelen > 1000) {
|
|
||||||
len = 990;
|
|
||||||
}
|
|
||||||
if (fwrite(line, len, 1, queue->mailf) != 1)
|
|
||||||
return (-1);
|
|
||||||
if (linelen <= 1000)
|
|
||||||
break;
|
|
||||||
if (fwrite("\n", 1, 1, queue->mailf) != 1)
|
|
||||||
return (-1);
|
|
||||||
line += 990;
|
|
||||||
linelen = strlen(line);
|
|
||||||
}
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
readmail(struct queue *queue, int nodot, int recp_from_header)
|
readmail(struct queue *queue, int nodot, int recp_from_header)
|
||||||
{
|
{
|
||||||
struct parse_state parse_state;
|
struct parse_state parse_state;
|
||||||
char *line = NULL;
|
char line[1000]; /* by RFC2822 */
|
||||||
ssize_t linelen;
|
size_t linelen;
|
||||||
size_t linecap = 0;
|
|
||||||
char newline[1000];
|
|
||||||
size_t error;
|
size_t error;
|
||||||
int had_headers = 0;
|
int had_headers = 0;
|
||||||
int had_from = 0;
|
int had_from = 0;
|
||||||
int had_messagid = 0;
|
int had_messagid = 0;
|
||||||
int had_date = 0;
|
int had_date = 0;
|
||||||
|
int had_last_line = 0;
|
||||||
int nocopy = 0;
|
int nocopy = 0;
|
||||||
|
|
||||||
parse_state.state = NONE;
|
parse_state.state = NONE;
|
||||||
@ -396,15 +372,24 @@ readmail(struct queue *queue, int nodot, int recp_from_header)
|
|||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
while (!feof(stdin)) {
|
while (!feof(stdin)) {
|
||||||
newline[0] = '\0';
|
if (fgets(line, sizeof(line) - 1, stdin) == NULL)
|
||||||
if ((linelen = getline(&line, &linecap, stdin)) <= 0)
|
|
||||||
break;
|
break;
|
||||||
|
if (had_last_line)
|
||||||
|
errlogx(EX_DATAERR, "bad mail input format:"
|
||||||
|
" from %s (uid %d) (envelope-from %s)",
|
||||||
|
username, useruid, queue->sender);
|
||||||
|
linelen = strlen(line);
|
||||||
|
if (linelen == 0 || line[linelen - 1] != '\n') {
|
||||||
|
/*
|
||||||
|
* This line did not end with a newline character.
|
||||||
|
* If we fix it, it better be the last line of
|
||||||
|
* the file.
|
||||||
|
*/
|
||||||
|
line[linelen] = '\n';
|
||||||
|
line[linelen + 1] = 0;
|
||||||
|
had_last_line = 1;
|
||||||
|
}
|
||||||
if (!had_headers) {
|
if (!had_headers) {
|
||||||
if (linelen > 1000)
|
|
||||||
errlogx(EX_DATAERR, "bad mail input format:"
|
|
||||||
" from %s (uid %d) (envelope-from %s)",
|
|
||||||
username, useruid, queue->sender);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unless this is a continuation, switch of
|
* Unless this is a continuation, switch of
|
||||||
* the Bcc: nocopy flag.
|
* the Bcc: nocopy flag.
|
||||||
@ -440,44 +425,36 @@ readmail(struct queue *queue, int nodot, int recp_from_header)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (line[0] == '\n' && !had_headers) {
|
if (strcmp(line, "\n") == 0 && !had_headers) {
|
||||||
had_headers = 1;
|
had_headers = 1;
|
||||||
while (!had_date || !had_messagid || !had_from) {
|
while (!had_date || !had_messagid || !had_from) {
|
||||||
if (!had_date) {
|
if (!had_date) {
|
||||||
had_date = 1;
|
had_date = 1;
|
||||||
snprintf(newline, sizeof(newline), "Date: %s\n", rfc822date());
|
snprintf(line, sizeof(line), "Date: %s\n", rfc822date());
|
||||||
} else if (!had_messagid) {
|
} else if (!had_messagid) {
|
||||||
/* XXX msgid, assign earlier and log? */
|
/* XXX msgid, assign earlier and log? */
|
||||||
had_messagid = 1;
|
had_messagid = 1;
|
||||||
snprintf(newline, sizeof(newline), "Message-Id: <%"PRIxMAX".%s.%"PRIxMAX"@%s>\n",
|
snprintf(line, sizeof(line), "Message-Id: <%"PRIxMAX".%s.%"PRIxMAX"@%s>\n",
|
||||||
(uintmax_t)time(NULL),
|
(uintmax_t)time(NULL),
|
||||||
queue->id,
|
queue->id,
|
||||||
(uintmax_t)random(),
|
(uintmax_t)random(),
|
||||||
hostname());
|
hostname());
|
||||||
} else if (!had_from) {
|
} else if (!had_from) {
|
||||||
had_from = 1;
|
had_from = 1;
|
||||||
snprintf(newline, sizeof(newline), "From: <%s>\n", queue->sender);
|
snprintf(line, sizeof(line), "From: <%s>\n", queue->sender);
|
||||||
}
|
}
|
||||||
if (fwrite(newline, strlen(newline), 1, queue->mailf) != 1)
|
if (fwrite(line, strlen(line), 1, queue->mailf) != 1)
|
||||||
goto fail;
|
return (-1);
|
||||||
}
|
}
|
||||||
strlcpy(newline, "\n", sizeof(newline));
|
strcpy(line, "\n");
|
||||||
}
|
}
|
||||||
if (!nodot && linelen == 2 && line[0] == '.')
|
if (!nodot && linelen == 2 && line[0] == '.')
|
||||||
break;
|
break;
|
||||||
if (!nocopy) {
|
if (!nocopy) {
|
||||||
if (newline[0] != '\0') {
|
if (fwrite(line, strlen(line), 1, queue->mailf) != 1)
|
||||||
if (fwrite(newline, strlen(newline), 1, queue->mailf) != 1)
|
return (-1);
|
||||||
goto fail;
|
|
||||||
} else {
|
|
||||||
if (writeline(queue, line, linelen) != 0)
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
fail:
|
|
||||||
free(line);
|
|
||||||
return (-1);
|
|
||||||
}
|
}
|
||||||
|
@ -54,10 +54,10 @@ INDXBIB?= indxbib
|
|||||||
PIC?= pic
|
PIC?= pic
|
||||||
REFER?= refer
|
REFER?= refer
|
||||||
.for _dev in ${PRINTERDEVICE:Mascii}
|
.for _dev in ${PRINTERDEVICE:Mascii}
|
||||||
ROFF.ascii?= nroff -Tascii -P-c ${TRFLAGS} -mtty-char ${MACROS} ${PAGES:C/^/-o/1}
|
ROFF.ascii?= groff -Tascii -P-c ${TRFLAGS} -mtty-char ${MACROS} ${PAGES:C/^/-o/1}
|
||||||
.endfor
|
.endfor
|
||||||
.for _dev in ${PRINTERDEVICE:Nascii}
|
.for _dev in ${PRINTERDEVICE:Nascii}
|
||||||
ROFF.${_dev}?= nroff -T${_dev} ${TRFLAGS} ${MACROS} ${PAGES:C/^/-o/1}
|
ROFF.${_dev}?= groff -T${_dev} ${TRFLAGS} ${MACROS} ${PAGES:C/^/-o/1}
|
||||||
.endfor
|
.endfor
|
||||||
SOELIM?= soelim
|
SOELIM?= soelim
|
||||||
TBL?= tbl
|
TBL?= tbl
|
||||||
|
@ -270,7 +270,6 @@ db_nextframe(struct amd64_frame **fp, db_addr_t *ip, struct thread *td)
|
|||||||
*fp = (struct amd64_frame *) rbp;
|
*fp = (struct amd64_frame *) rbp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
db_backtrace(struct thread *td, struct trapframe *tf, struct amd64_frame *frame,
|
db_backtrace(struct thread *td, struct trapframe *tf, struct amd64_frame *frame,
|
||||||
db_addr_t pc, register_t sp, int count)
|
db_addr_t pc, register_t sp, int count)
|
||||||
@ -385,20 +384,6 @@ db_trace_self(void)
|
|||||||
db_backtrace(curthread, NULL, frame, callpc, 0, -1);
|
db_backtrace(curthread, NULL, frame, callpc, 0, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
db_trace_self_depth(int depth)
|
|
||||||
{
|
|
||||||
struct amd64_frame *frame;
|
|
||||||
db_addr_t callpc;
|
|
||||||
register_t rbp;
|
|
||||||
|
|
||||||
__asm __volatile("movq %%rbp,%0" : "=r" (rbp));
|
|
||||||
frame = (struct amd64_frame *)rbp;
|
|
||||||
callpc = (db_addr_t)db_get_value((long)&frame->f_retaddr, 8, FALSE);
|
|
||||||
frame = frame->f_frame;
|
|
||||||
db_backtrace(curthread, NULL, frame, callpc, 0, depth);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
db_trace_thread(struct thread *thr, int count)
|
db_trace_thread(struct thread *thr, int count)
|
||||||
{
|
{
|
||||||
|
@ -27,7 +27,6 @@
|
|||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/systm.h>
|
|
||||||
#include <sys/imgact.h>
|
#include <sys/imgact.h>
|
||||||
#include <sys/kernel.h>
|
#include <sys/kernel.h>
|
||||||
#include <sys/proc.h>
|
#include <sys/proc.h>
|
||||||
@ -39,7 +38,6 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <machine/frame.h>
|
#include <machine/frame.h>
|
||||||
#include <machine/pcb.h>
|
#include <machine/pcb.h>
|
||||||
#include <machine/vmparam.h>
|
#include <machine/vmparam.h>
|
||||||
#include <machine/cpu.h>
|
|
||||||
|
|
||||||
#include <compat/cloudabi/cloudabi_util.h>
|
#include <compat/cloudabi/cloudabi_util.h>
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ struct ctl_lun_io_stats {
|
|||||||
uint64_t lun_number;
|
uint64_t lun_number;
|
||||||
uint32_t blocksize;
|
uint32_t blocksize;
|
||||||
ctl_lun_stats_flags flags;
|
ctl_lun_stats_flags flags;
|
||||||
struct ctl_lun_io_port_stats *ports;
|
struct ctl_lun_io_port_stats ports[CTL_MAX_PORTS];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ctl_stats {
|
struct ctl_stats {
|
||||||
|
@ -34,8 +34,6 @@
|
|||||||
|
|
||||||
#include <sys/dtrace.h>
|
#include <sys/dtrace.h>
|
||||||
|
|
||||||
#include <machine/cpu.h>
|
|
||||||
|
|
||||||
#include "fbt.h"
|
#include "fbt.h"
|
||||||
|
|
||||||
#define FBT_PUSHL_EBP 0x55
|
#define FBT_PUSHL_EBP 0x55
|
||||||
|
@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <sys/socketvar.h>
|
#include <sys/socketvar.h>
|
||||||
#include <sys/syscallsubr.h>
|
#include <sys/syscallsubr.h>
|
||||||
#include <sys/sysproto.h>
|
#include <sys/sysproto.h>
|
||||||
#include <sys/seq.h>
|
|
||||||
#include <sys/systm.h>
|
#include <sys/systm.h>
|
||||||
#include <sys/unistd.h>
|
#include <sys/unistd.h>
|
||||||
#include <sys/vnode.h>
|
#include <sys/vnode.h>
|
||||||
|
@ -27,7 +27,6 @@
|
|||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/systm.h>
|
|
||||||
#include <sys/proc.h>
|
#include <sys/proc.h>
|
||||||
#include <sys/syscallsubr.h>
|
#include <sys/syscallsubr.h>
|
||||||
|
|
||||||
|
@ -72,14 +72,6 @@ struct linux_kmem_cache {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#define SLAB_HWCACHE_ALIGN 0x0001
|
#define SLAB_HWCACHE_ALIGN 0x0001
|
||||||
static inline void *
|
|
||||||
kmalloc_array(size_t n, size_t size, gfp_t flags)
|
|
||||||
{
|
|
||||||
if (size != 0 && n > SIZE_MAX / size)
|
|
||||||
return (NULL);
|
|
||||||
return kmalloc(n * size, flags);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
linux_kmem_ctor(void *mem, int size, void *arg, int flags)
|
linux_kmem_ctor(void *mem, int size, void *arg, int flags)
|
||||||
|
@ -1022,25 +1022,23 @@ ACPI_EXPORT_SYMBOL (AcpiDetachData)
|
|||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
*
|
*
|
||||||
* FUNCTION: AcpiGetDataFull
|
* FUNCTION: AcpiGetData
|
||||||
*
|
*
|
||||||
* PARAMETERS: ObjHandle - Namespace node
|
* PARAMETERS: ObjHandle - Namespace node
|
||||||
* Handle - Handler used in call to attach_data
|
* Handler - Handler used in call to AttachData
|
||||||
* Data - Where the data is returned
|
* Data - Where the data is returned
|
||||||
* Callback - function to execute before returning
|
|
||||||
*
|
*
|
||||||
* RETURN: Status
|
* RETURN: Status
|
||||||
*
|
*
|
||||||
* DESCRIPTION: Retrieve data that was previously attached to a namespace node
|
* DESCRIPTION: Retrieve data that was previously attached to a namespace node.
|
||||||
* and execute a callback before returning.
|
|
||||||
*
|
*
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
ACPI_STATUS
|
ACPI_STATUS
|
||||||
AcpiGetDataFull (
|
AcpiGetData (
|
||||||
ACPI_HANDLE ObjHandle,
|
ACPI_HANDLE ObjHandle,
|
||||||
ACPI_OBJECT_HANDLER Handler,
|
ACPI_OBJECT_HANDLER Handler,
|
||||||
void **Data,
|
void **Data)
|
||||||
void (*Callback)(void *))
|
|
||||||
{
|
{
|
||||||
ACPI_NAMESPACE_NODE *Node;
|
ACPI_NAMESPACE_NODE *Node;
|
||||||
ACPI_STATUS Status;
|
ACPI_STATUS Status;
|
||||||
@ -1071,34 +1069,10 @@ AcpiGetDataFull (
|
|||||||
}
|
}
|
||||||
|
|
||||||
Status = AcpiNsGetAttachedData (Node, Handler, Data);
|
Status = AcpiNsGetAttachedData (Node, Handler, Data);
|
||||||
if (ACPI_SUCCESS(Status) && Callback) {
|
|
||||||
Callback(*Data);
|
|
||||||
}
|
|
||||||
UnlockAndExit:
|
UnlockAndExit:
|
||||||
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||||
return (Status);
|
return (Status);
|
||||||
}
|
}
|
||||||
ACPI_EXPORT_SYMBOL (AcpiGetDataFull)
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
*
|
|
||||||
* FUNCTION: AcpiGetData
|
|
||||||
*
|
|
||||||
* PARAMETERS: ObjHandle - Namespace node
|
|
||||||
* Handler - Handler used in call to AttachData
|
|
||||||
* Data - Where the data is returned
|
|
||||||
*
|
|
||||||
* RETURN: Status
|
|
||||||
*
|
|
||||||
* DESCRIPTION: Retrieve data that was previously attached to a namespace node.
|
|
||||||
*
|
|
||||||
******************************************************************************/
|
|
||||||
ACPI_STATUS
|
|
||||||
AcpiGetData (
|
|
||||||
ACPI_HANDLE ObjHandle,
|
|
||||||
ACPI_OBJECT_HANDLER Handler,
|
|
||||||
void **Data)
|
|
||||||
{
|
|
||||||
return (AcpiGetDataFull(ObjHandle, Handler, Data, NULL));
|
|
||||||
}
|
|
||||||
ACPI_EXPORT_SYMBOL (AcpiGetData)
|
ACPI_EXPORT_SYMBOL (AcpiGetData)
|
||||||
|
@ -670,14 +670,6 @@ AcpiGetData (
|
|||||||
ACPI_OBJECT_HANDLER Handler,
|
ACPI_OBJECT_HANDLER Handler,
|
||||||
void **Data))
|
void **Data))
|
||||||
|
|
||||||
ACPI_EXTERNAL_RETURN_STATUS (
|
|
||||||
ACPI_STATUS
|
|
||||||
AcpiGetDataFull (
|
|
||||||
ACPI_HANDLE Object,
|
|
||||||
ACPI_OBJECT_HANDLER Handler,
|
|
||||||
void **Data,
|
|
||||||
void (*Callback)(void *)))
|
|
||||||
|
|
||||||
ACPI_EXTERNAL_RETURN_STATUS (
|
ACPI_EXTERNAL_RETURN_STATUS (
|
||||||
ACPI_STATUS
|
ACPI_STATUS
|
||||||
AcpiDebugTrace (
|
AcpiDebugTrace (
|
||||||
|
@ -219,7 +219,6 @@ bool db_stop_at_pc(int type, int code, bool *is_breakpoint,
|
|||||||
bool *is_watchpoint);
|
bool *is_watchpoint);
|
||||||
#define db_strcpy strcpy
|
#define db_strcpy strcpy
|
||||||
void db_trace_self(void);
|
void db_trace_self(void);
|
||||||
void db_trace_self_depth(int);
|
|
||||||
int db_trace_thread(struct thread *, int);
|
int db_trace_thread(struct thread *, int);
|
||||||
bool db_value_of_name(const char *name, db_expr_t *valuep);
|
bool db_value_of_name(const char *name, db_expr_t *valuep);
|
||||||
bool db_value_of_name_pcpu(const char *name, db_expr_t *valuep);
|
bool db_value_of_name_pcpu(const char *name, db_expr_t *valuep);
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include <dev/drm2/drmP.h>
|
#include <dev/drm2/drmP.h>
|
||||||
|
#include <linux/slab.h>
|
||||||
|
|
||||||
#if __OS_HAS_AGP
|
#if __OS_HAS_AGP
|
||||||
|
|
||||||
@ -208,15 +209,13 @@ int drm_agp_alloc(struct drm_device *dev, struct drm_agp_buffer *request)
|
|||||||
|
|
||||||
if (!dev->agp || !dev->agp->acquired)
|
if (!dev->agp || !dev->agp->acquired)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
if (!(entry = malloc(sizeof(*entry), DRM_MEM_AGPLISTS, M_NOWAIT)))
|
if (!(entry = kzalloc(sizeof(*entry), GFP_KERNEL)))
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
memset(entry, 0, sizeof(*entry));
|
|
||||||
|
|
||||||
pages = (request->size + PAGE_SIZE - 1) / PAGE_SIZE;
|
pages = (request->size + PAGE_SIZE - 1) / PAGE_SIZE;
|
||||||
type = (u32) request->type;
|
type = (u32) request->type;
|
||||||
if (!(memory = agp_alloc_memory(dev->agp->bridge, type, pages << PAGE_SHIFT))) {
|
if (!(memory = agp_alloc_memory(dev->agp->bridge, type, pages << PAGE_SHIFT))) {
|
||||||
free(entry, DRM_MEM_AGPLISTS);
|
kfree(entry);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -376,7 +375,7 @@ int drm_agp_free(struct drm_device *dev, struct drm_agp_buffer *request)
|
|||||||
list_del(&entry->head);
|
list_del(&entry->head);
|
||||||
|
|
||||||
drm_free_agp(entry->memory, entry->pages);
|
drm_free_agp(entry->memory, entry->pages);
|
||||||
free(entry, DRM_MEM_AGPLISTS);
|
kfree(entry);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(drm_agp_free);
|
EXPORT_SYMBOL(drm_agp_free);
|
||||||
@ -404,12 +403,11 @@ struct drm_agp_head *drm_agp_init(struct drm_device *dev)
|
|||||||
{
|
{
|
||||||
struct drm_agp_head *head = NULL;
|
struct drm_agp_head *head = NULL;
|
||||||
|
|
||||||
if (!(head = malloc(sizeof(*head), DRM_MEM_AGPLISTS, M_NOWAIT)))
|
if (!(head = kzalloc(sizeof(*head), GFP_KERNEL)))
|
||||||
return NULL;
|
return NULL;
|
||||||
memset((void *)head, 0, sizeof(*head));
|
|
||||||
head->bridge = agp_find_device();
|
head->bridge = agp_find_device();
|
||||||
if (!head->bridge) {
|
if (!head->bridge) {
|
||||||
free(head, DRM_MEM_AGPLISTS);
|
kfree(head);
|
||||||
return NULL;
|
return NULL;
|
||||||
} else {
|
} else {
|
||||||
agp_get_info(head->bridge, &head->agp_info);
|
agp_get_info(head->bridge, &head->agp_info);
|
||||||
|
@ -39,9 +39,6 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/shm.h>
|
#include <sys/shm.h>
|
||||||
|
|
||||||
#include <linux/vmalloc.h>
|
|
||||||
#include <linux/slab.h>
|
|
||||||
|
|
||||||
#include <dev/pci/pcireg.h>
|
#include <dev/pci/pcireg.h>
|
||||||
|
|
||||||
#include <dev/drm2/drmP.h>
|
#include <dev/drm2/drmP.h>
|
||||||
@ -219,7 +216,7 @@ static int drm_addmap_core(struct drm_device * dev, resource_size_t offset,
|
|||||||
int ret;
|
int ret;
|
||||||
int align;
|
int align;
|
||||||
|
|
||||||
map = kmalloc(sizeof(*map), GFP_KERNEL);
|
map = malloc(sizeof(*map), DRM_MEM_MAPS, M_NOWAIT);
|
||||||
if (!map)
|
if (!map)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
@ -233,7 +230,7 @@ static int drm_addmap_core(struct drm_device * dev, resource_size_t offset,
|
|||||||
* when processes fork.
|
* when processes fork.
|
||||||
*/
|
*/
|
||||||
if ((map->flags & _DRM_REMOVABLE) && map->type != _DRM_SHM) {
|
if ((map->flags & _DRM_REMOVABLE) && map->type != _DRM_SHM) {
|
||||||
kfree(map);
|
free(map, DRM_MEM_MAPS);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
DRM_DEBUG("offset = 0x%08llx, size = 0x%08lx, type = %d\n",
|
DRM_DEBUG("offset = 0x%08llx, size = 0x%08lx, type = %d\n",
|
||||||
@ -252,7 +249,7 @@ static int drm_addmap_core(struct drm_device * dev, resource_size_t offset,
|
|||||||
* constant.
|
* constant.
|
||||||
*/
|
*/
|
||||||
if ((map->offset & ((resource_size_t)PAGE_MASK)) || (map->size & (PAGE_MASK))) {
|
if ((map->offset & ((resource_size_t)PAGE_MASK)) || (map->size & (PAGE_MASK))) {
|
||||||
kfree(map);
|
free(map, DRM_MEM_MAPS);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
map->mtrr = -1;
|
map->mtrr = -1;
|
||||||
@ -284,7 +281,7 @@ static int drm_addmap_core(struct drm_device * dev, resource_size_t offset,
|
|||||||
list->map->size = map->size;
|
list->map->size = map->size;
|
||||||
}
|
}
|
||||||
|
|
||||||
kfree(map);
|
free(map, DRM_MEM_MAPS);
|
||||||
*maplist = list;
|
*maplist = list;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -301,7 +298,7 @@ static int drm_addmap_core(struct drm_device * dev, resource_size_t offset,
|
|||||||
if (map->type == _DRM_REGISTERS) {
|
if (map->type == _DRM_REGISTERS) {
|
||||||
drm_core_ioremap(map, dev);
|
drm_core_ioremap(map, dev);
|
||||||
if (!map->handle) {
|
if (!map->handle) {
|
||||||
kfree(map);
|
free(map, DRM_MEM_MAPS);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -317,23 +314,23 @@ static int drm_addmap_core(struct drm_device * dev, resource_size_t offset,
|
|||||||
list->map->size = map->size;
|
list->map->size = map->size;
|
||||||
}
|
}
|
||||||
|
|
||||||
kfree(map);
|
free(map, DRM_MEM_MAPS);
|
||||||
*maplist = list;
|
*maplist = list;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
map->handle = vmalloc_user(map->size);
|
map->handle = malloc(map->size, DRM_MEM_MAPS, M_NOWAIT);
|
||||||
DRM_DEBUG("%lu %d %p\n",
|
DRM_DEBUG("%lu %d %p\n",
|
||||||
map->size, drm_order(map->size), map->handle);
|
map->size, drm_order(map->size), map->handle);
|
||||||
if (!map->handle) {
|
if (!map->handle) {
|
||||||
kfree(map);
|
free(map, DRM_MEM_MAPS);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
map->offset = (unsigned long)map->handle;
|
map->offset = (unsigned long)map->handle;
|
||||||
if (map->flags & _DRM_CONTAINS_LOCK) {
|
if (map->flags & _DRM_CONTAINS_LOCK) {
|
||||||
/* Prevent a 2nd X Server from creating a 2nd lock */
|
/* Prevent a 2nd X Server from creating a 2nd lock */
|
||||||
if (dev->primary->master->lock.hw_lock != NULL) {
|
if (dev->primary->master->lock.hw_lock != NULL) {
|
||||||
kfree(map->handle);
|
free(map->handle, DRM_MEM_MAPS);
|
||||||
kfree(map);
|
free(map, DRM_MEM_MAPS);
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
dev->sigdata.lock = dev->primary->master->lock.hw_lock = map->handle; /* Pointer to lock */
|
dev->sigdata.lock = dev->primary->master->lock.hw_lock = map->handle; /* Pointer to lock */
|
||||||
@ -344,7 +341,7 @@ static int drm_addmap_core(struct drm_device * dev, resource_size_t offset,
|
|||||||
int valid = 0;
|
int valid = 0;
|
||||||
|
|
||||||
if (!drm_core_has_AGP(dev)) {
|
if (!drm_core_has_AGP(dev)) {
|
||||||
kfree(map);
|
free(map, DRM_MEM_MAPS);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
@ -379,7 +376,7 @@ static int drm_addmap_core(struct drm_device * dev, resource_size_t offset,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!list_empty(&dev->agp->memory) && !valid) {
|
if (!list_empty(&dev->agp->memory) && !valid) {
|
||||||
kfree(map);
|
free(map, DRM_MEM_MAPS);
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
}
|
}
|
||||||
DRM_DEBUG("AGP offset = 0x%08llx, size = 0x%08lx\n",
|
DRM_DEBUG("AGP offset = 0x%08llx, size = 0x%08lx\n",
|
||||||
@ -392,7 +389,7 @@ static int drm_addmap_core(struct drm_device * dev, resource_size_t offset,
|
|||||||
break;
|
break;
|
||||||
case _DRM_SCATTER_GATHER:
|
case _DRM_SCATTER_GATHER:
|
||||||
if (!dev->sg) {
|
if (!dev->sg) {
|
||||||
kfree(map);
|
free(map, DRM_MEM_MAPS);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
map->handle = (void *)(dev->sg->vaddr + offset);
|
map->handle = (void *)(dev->sg->vaddr + offset);
|
||||||
@ -408,7 +405,7 @@ static int drm_addmap_core(struct drm_device * dev, resource_size_t offset,
|
|||||||
align = PAGE_SIZE;
|
align = PAGE_SIZE;
|
||||||
dmah = drm_pci_alloc(dev, map->size, align, BUS_SPACE_MAXADDR);
|
dmah = drm_pci_alloc(dev, map->size, align, BUS_SPACE_MAXADDR);
|
||||||
if (!dmah) {
|
if (!dmah) {
|
||||||
kfree(map);
|
free(map, DRM_MEM_MAPS);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
map->handle = dmah->vaddr;
|
map->handle = dmah->vaddr;
|
||||||
@ -416,15 +413,15 @@ static int drm_addmap_core(struct drm_device * dev, resource_size_t offset,
|
|||||||
map->dmah = dmah;
|
map->dmah = dmah;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
kfree(map);
|
free(map, DRM_MEM_MAPS);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
list = kzalloc(sizeof(*list), GFP_KERNEL);
|
list = malloc(sizeof(*list), DRM_MEM_MAPS, M_ZERO | M_NOWAIT);
|
||||||
if (!list) {
|
if (!list) {
|
||||||
if (map->type == _DRM_REGISTERS)
|
if (map->type == _DRM_REGISTERS)
|
||||||
drm_core_ioremapfree(map, dev);
|
drm_core_ioremapfree(map, dev);
|
||||||
kfree(map);
|
free(map, DRM_MEM_MAPS);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
list->map = map;
|
list->map = map;
|
||||||
@ -441,8 +438,8 @@ static int drm_addmap_core(struct drm_device * dev, resource_size_t offset,
|
|||||||
if (ret) {
|
if (ret) {
|
||||||
if (map->type == _DRM_REGISTERS)
|
if (map->type == _DRM_REGISTERS)
|
||||||
drm_core_ioremapfree(map, dev);
|
drm_core_ioremapfree(map, dev);
|
||||||
kfree(map);
|
free(map, DRM_MEM_MAPS);
|
||||||
kfree(list);
|
free(list, DRM_MEM_MAPS);
|
||||||
DRM_UNLOCK(dev);
|
DRM_UNLOCK(dev);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -526,7 +523,7 @@ int drm_rmmap_locked(struct drm_device *dev, struct drm_local_map *map)
|
|||||||
list_del(&r_list->head);
|
list_del(&r_list->head);
|
||||||
drm_ht_remove_key(&dev->map_hash,
|
drm_ht_remove_key(&dev->map_hash,
|
||||||
r_list->user_token >> PAGE_SHIFT);
|
r_list->user_token >> PAGE_SHIFT);
|
||||||
kfree(r_list);
|
free(r_list, DRM_MEM_MAPS);
|
||||||
found = 1;
|
found = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -548,7 +545,7 @@ int drm_rmmap_locked(struct drm_device *dev, struct drm_local_map *map)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case _DRM_SHM:
|
case _DRM_SHM:
|
||||||
kfree(map->handle);
|
free(map->handle, DRM_MEM_MAPS);
|
||||||
if (master) {
|
if (master) {
|
||||||
if (dev->sigdata.lock == master->lock.hw_lock)
|
if (dev->sigdata.lock == master->lock.hw_lock)
|
||||||
dev->sigdata.lock = NULL;
|
dev->sigdata.lock = NULL;
|
||||||
@ -567,7 +564,7 @@ int drm_rmmap_locked(struct drm_device *dev, struct drm_local_map *map)
|
|||||||
DRM_ERROR("tried to rmmap GEM object\n");
|
DRM_ERROR("tried to rmmap GEM object\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
kfree(map);
|
free(map, DRM_MEM_MAPS);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -658,16 +655,16 @@ static void drm_cleanup_buf_error(struct drm_device * dev,
|
|||||||
drm_pci_free(dev, entry->seglist[i]);
|
drm_pci_free(dev, entry->seglist[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
kfree(entry->seglist);
|
free(entry->seglist, DRM_MEM_SEGS);
|
||||||
|
|
||||||
entry->seg_count = 0;
|
entry->seg_count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entry->buf_count) {
|
if (entry->buf_count) {
|
||||||
for (i = 0; i < entry->buf_count; i++) {
|
for (i = 0; i < entry->buf_count; i++) {
|
||||||
kfree(entry->buflist[i].dev_private);
|
free(entry->buflist[i].dev_private, DRM_MEM_BUFS);
|
||||||
}
|
}
|
||||||
kfree(entry->buflist);
|
free(entry->buflist, DRM_MEM_BUFS);
|
||||||
|
|
||||||
entry->buf_count = 0;
|
entry->buf_count = 0;
|
||||||
}
|
}
|
||||||
@ -764,7 +761,8 @@ int drm_addbufs_agp(struct drm_device * dev, struct drm_buf_desc * request)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
entry->buflist = kcalloc(count, sizeof(*entry->buflist), GFP_KERNEL);
|
entry->buflist = malloc(count * sizeof(*entry->buflist), DRM_MEM_BUFS,
|
||||||
|
M_NOWAIT | M_ZERO);
|
||||||
if (!entry->buflist) {
|
if (!entry->buflist) {
|
||||||
DRM_UNLOCK(dev);
|
DRM_UNLOCK(dev);
|
||||||
atomic_dec(&dev->buf_alloc);
|
atomic_dec(&dev->buf_alloc);
|
||||||
@ -792,7 +790,8 @@ int drm_addbufs_agp(struct drm_device * dev, struct drm_buf_desc * request)
|
|||||||
buf->file_priv = NULL;
|
buf->file_priv = NULL;
|
||||||
|
|
||||||
buf->dev_priv_size = dev->driver->dev_priv_size;
|
buf->dev_priv_size = dev->driver->dev_priv_size;
|
||||||
buf->dev_private = kzalloc(buf->dev_priv_size, GFP_KERNEL);
|
buf->dev_private = malloc(buf->dev_priv_size, DRM_MEM_BUFS,
|
||||||
|
M_NOWAIT | M_ZERO);
|
||||||
if (!buf->dev_private) {
|
if (!buf->dev_private) {
|
||||||
/* Set count correctly so we free the proper amount. */
|
/* Set count correctly so we free the proper amount. */
|
||||||
entry->buf_count = count;
|
entry->buf_count = count;
|
||||||
@ -811,8 +810,9 @@ int drm_addbufs_agp(struct drm_device * dev, struct drm_buf_desc * request)
|
|||||||
|
|
||||||
DRM_DEBUG("byte_count: %d\n", byte_count);
|
DRM_DEBUG("byte_count: %d\n", byte_count);
|
||||||
|
|
||||||
temp_buflist = krealloc(dma->buflist,
|
temp_buflist = realloc(dma->buflist,
|
||||||
(dma->buf_count + entry->buf_count) * sizeof(*dma->buflist), GFP_KERNEL);
|
(dma->buf_count + entry->buf_count) * sizeof(*dma->buflist),
|
||||||
|
DRM_MEM_BUFS, M_NOWAIT);
|
||||||
if (!temp_buflist) {
|
if (!temp_buflist) {
|
||||||
/* Free the entry because it isn't valid */
|
/* Free the entry because it isn't valid */
|
||||||
drm_cleanup_buf_error(dev, entry);
|
drm_cleanup_buf_error(dev, entry);
|
||||||
@ -912,16 +912,18 @@ int drm_addbufs_pci(struct drm_device * dev, struct drm_buf_desc * request)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
entry->buflist = kcalloc(count, sizeof(*entry->buflist), GFP_KERNEL);
|
entry->buflist = malloc(count * sizeof(*entry->buflist), DRM_MEM_BUFS,
|
||||||
|
M_NOWAIT | M_ZERO);
|
||||||
if (!entry->buflist) {
|
if (!entry->buflist) {
|
||||||
DRM_UNLOCK(dev);
|
DRM_UNLOCK(dev);
|
||||||
atomic_dec(&dev->buf_alloc);
|
atomic_dec(&dev->buf_alloc);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
entry->seglist = kcalloc(count, sizeof(*entry->seglist), GFP_KERNEL);
|
entry->seglist = malloc(count * sizeof(*entry->seglist), DRM_MEM_SEGS,
|
||||||
|
M_NOWAIT | M_ZERO);
|
||||||
if (!entry->seglist) {
|
if (!entry->seglist) {
|
||||||
kfree(entry->buflist);
|
free(entry->buflist, DRM_MEM_BUFS);
|
||||||
DRM_UNLOCK(dev);
|
DRM_UNLOCK(dev);
|
||||||
atomic_dec(&dev->buf_alloc);
|
atomic_dec(&dev->buf_alloc);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
@ -930,12 +932,11 @@ int drm_addbufs_pci(struct drm_device * dev, struct drm_buf_desc * request)
|
|||||||
/* Keep the original pagelist until we know all the allocations
|
/* Keep the original pagelist until we know all the allocations
|
||||||
* have succeeded
|
* have succeeded
|
||||||
*/
|
*/
|
||||||
temp_pagelist = kmalloc_array(dma->page_count + (count << page_order),
|
temp_pagelist = malloc((dma->page_count + (count << page_order)) *
|
||||||
sizeof(*dma->pagelist),
|
sizeof(*dma->pagelist), DRM_MEM_PAGES, M_NOWAIT);
|
||||||
GFP_KERNEL);
|
|
||||||
if (!temp_pagelist) {
|
if (!temp_pagelist) {
|
||||||
kfree(entry->buflist);
|
free(entry->buflist, DRM_MEM_BUFS);
|
||||||
kfree(entry->seglist);
|
free(entry->seglist, DRM_MEM_SEGS);
|
||||||
DRM_UNLOCK(dev);
|
DRM_UNLOCK(dev);
|
||||||
atomic_dec(&dev->buf_alloc);
|
atomic_dec(&dev->buf_alloc);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
@ -959,7 +960,7 @@ int drm_addbufs_pci(struct drm_device * dev, struct drm_buf_desc * request)
|
|||||||
entry->buf_count = count;
|
entry->buf_count = count;
|
||||||
entry->seg_count = count;
|
entry->seg_count = count;
|
||||||
drm_cleanup_buf_error(dev, entry);
|
drm_cleanup_buf_error(dev, entry);
|
||||||
kfree(temp_pagelist);
|
free(temp_pagelist, DRM_MEM_PAGES);
|
||||||
DRM_UNLOCK(dev);
|
DRM_UNLOCK(dev);
|
||||||
atomic_dec(&dev->buf_alloc);
|
atomic_dec(&dev->buf_alloc);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
@ -989,14 +990,14 @@ int drm_addbufs_pci(struct drm_device * dev, struct drm_buf_desc * request)
|
|||||||
buf->file_priv = NULL;
|
buf->file_priv = NULL;
|
||||||
|
|
||||||
buf->dev_priv_size = dev->driver->dev_priv_size;
|
buf->dev_priv_size = dev->driver->dev_priv_size;
|
||||||
buf->dev_private = kzalloc(buf->dev_priv_size,
|
buf->dev_private = malloc(buf->dev_priv_size,
|
||||||
GFP_KERNEL);
|
DRM_MEM_BUFS, M_NOWAIT | M_ZERO);
|
||||||
if (!buf->dev_private) {
|
if (!buf->dev_private) {
|
||||||
/* Set count correctly so we free the proper amount. */
|
/* Set count correctly so we free the proper amount. */
|
||||||
entry->buf_count = count;
|
entry->buf_count = count;
|
||||||
entry->seg_count = count;
|
entry->seg_count = count;
|
||||||
drm_cleanup_buf_error(dev, entry);
|
drm_cleanup_buf_error(dev, entry);
|
||||||
kfree(temp_pagelist);
|
free(temp_pagelist, DRM_MEM_PAGES);
|
||||||
DRM_UNLOCK(dev);
|
DRM_UNLOCK(dev);
|
||||||
atomic_dec(&dev->buf_alloc);
|
atomic_dec(&dev->buf_alloc);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
@ -1008,13 +1009,13 @@ int drm_addbufs_pci(struct drm_device * dev, struct drm_buf_desc * request)
|
|||||||
byte_count += PAGE_SIZE << page_order;
|
byte_count += PAGE_SIZE << page_order;
|
||||||
}
|
}
|
||||||
|
|
||||||
temp_buflist = krealloc(dma->buflist,
|
temp_buflist = realloc(dma->buflist,
|
||||||
(dma->buf_count + entry->buf_count) *
|
(dma->buf_count + entry->buf_count) * sizeof(*dma->buflist),
|
||||||
sizeof(*dma->buflist), GFP_KERNEL);
|
DRM_MEM_BUFS, M_NOWAIT);
|
||||||
if (!temp_buflist) {
|
if (!temp_buflist) {
|
||||||
/* Free the entry because it isn't valid */
|
/* Free the entry because it isn't valid */
|
||||||
drm_cleanup_buf_error(dev, entry);
|
drm_cleanup_buf_error(dev, entry);
|
||||||
kfree(temp_pagelist);
|
free(temp_pagelist, DRM_MEM_PAGES);
|
||||||
DRM_UNLOCK(dev);
|
DRM_UNLOCK(dev);
|
||||||
atomic_dec(&dev->buf_alloc);
|
atomic_dec(&dev->buf_alloc);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
@ -1029,7 +1030,7 @@ int drm_addbufs_pci(struct drm_device * dev, struct drm_buf_desc * request)
|
|||||||
* with the new one.
|
* with the new one.
|
||||||
*/
|
*/
|
||||||
if (dma->page_count) {
|
if (dma->page_count) {
|
||||||
kfree(dma->pagelist);
|
free(dma->pagelist, DRM_MEM_PAGES);
|
||||||
}
|
}
|
||||||
dma->pagelist = temp_pagelist;
|
dma->pagelist = temp_pagelist;
|
||||||
|
|
||||||
@ -1123,7 +1124,8 @@ static int drm_addbufs_sg(struct drm_device * dev, struct drm_buf_desc * request
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
entry->buflist = kcalloc(count, sizeof(*entry->buflist), GFP_KERNEL);
|
entry->buflist = malloc(count * sizeof(*entry->buflist), DRM_MEM_BUFS,
|
||||||
|
M_NOWAIT | M_ZERO);
|
||||||
if (!entry->buflist) {
|
if (!entry->buflist) {
|
||||||
DRM_UNLOCK(dev);
|
DRM_UNLOCK(dev);
|
||||||
atomic_dec(&dev->buf_alloc);
|
atomic_dec(&dev->buf_alloc);
|
||||||
@ -1152,7 +1154,8 @@ static int drm_addbufs_sg(struct drm_device * dev, struct drm_buf_desc * request
|
|||||||
buf->file_priv = NULL;
|
buf->file_priv = NULL;
|
||||||
|
|
||||||
buf->dev_priv_size = dev->driver->dev_priv_size;
|
buf->dev_priv_size = dev->driver->dev_priv_size;
|
||||||
buf->dev_private = kzalloc(buf->dev_priv_size, GFP_KERNEL);
|
buf->dev_private = malloc(buf->dev_priv_size, DRM_MEM_BUFS,
|
||||||
|
M_NOWAIT | M_ZERO);
|
||||||
if (!buf->dev_private) {
|
if (!buf->dev_private) {
|
||||||
/* Set count correctly so we free the proper amount. */
|
/* Set count correctly so we free the proper amount. */
|
||||||
entry->buf_count = count;
|
entry->buf_count = count;
|
||||||
@ -1171,9 +1174,9 @@ static int drm_addbufs_sg(struct drm_device * dev, struct drm_buf_desc * request
|
|||||||
|
|
||||||
DRM_DEBUG("byte_count: %d\n", byte_count);
|
DRM_DEBUG("byte_count: %d\n", byte_count);
|
||||||
|
|
||||||
temp_buflist = krealloc(dma->buflist,
|
temp_buflist = realloc(dma->buflist,
|
||||||
(dma->buf_count + entry->buf_count) *
|
(dma->buf_count + entry->buf_count) * sizeof(*dma->buflist),
|
||||||
sizeof(*dma->buflist), GFP_KERNEL);
|
DRM_MEM_BUFS, M_NOWAIT);
|
||||||
if (!temp_buflist) {
|
if (!temp_buflist) {
|
||||||
/* Free the entry because it isn't valid */
|
/* Free the entry because it isn't valid */
|
||||||
drm_cleanup_buf_error(dev, entry);
|
drm_cleanup_buf_error(dev, entry);
|
||||||
@ -1277,7 +1280,8 @@ static int drm_addbufs_fb(struct drm_device * dev, struct drm_buf_desc * request
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
entry->buflist = kzalloc(count * sizeof(*entry->buflist), GFP_KERNEL);
|
entry->buflist = malloc(count * sizeof(*entry->buflist), DRM_MEM_BUFS,
|
||||||
|
M_NOWAIT | M_ZERO);
|
||||||
if (!entry->buflist) {
|
if (!entry->buflist) {
|
||||||
DRM_UNLOCK(dev);
|
DRM_UNLOCK(dev);
|
||||||
atomic_dec(&dev->buf_alloc);
|
atomic_dec(&dev->buf_alloc);
|
||||||
@ -1305,7 +1309,8 @@ static int drm_addbufs_fb(struct drm_device * dev, struct drm_buf_desc * request
|
|||||||
buf->file_priv = NULL;
|
buf->file_priv = NULL;
|
||||||
|
|
||||||
buf->dev_priv_size = dev->driver->dev_priv_size;
|
buf->dev_priv_size = dev->driver->dev_priv_size;
|
||||||
buf->dev_private = kmalloc(buf->dev_priv_size, GFP_KERNEL);
|
buf->dev_private = malloc(buf->dev_priv_size, DRM_MEM_BUFS,
|
||||||
|
M_NOWAIT | M_ZERO);
|
||||||
if (!buf->dev_private) {
|
if (!buf->dev_private) {
|
||||||
/* Set count correctly so we free the proper amount. */
|
/* Set count correctly so we free the proper amount. */
|
||||||
entry->buf_count = count;
|
entry->buf_count = count;
|
||||||
@ -1324,8 +1329,9 @@ static int drm_addbufs_fb(struct drm_device * dev, struct drm_buf_desc * request
|
|||||||
|
|
||||||
DRM_DEBUG("byte_count: %d\n", byte_count);
|
DRM_DEBUG("byte_count: %d\n", byte_count);
|
||||||
|
|
||||||
temp_buflist = krealloc(dma->buflist,
|
temp_buflist = realloc(dma->buflist,
|
||||||
(dma->buf_count + entry->buf_count) * sizeof(*dma->buflist), GFP_KERNEL);
|
(dma->buf_count + entry->buf_count) * sizeof(*dma->buflist),
|
||||||
|
DRM_MEM_BUFS, M_NOWAIT);
|
||||||
if (!temp_buflist) {
|
if (!temp_buflist) {
|
||||||
/* Free the entry because it isn't valid */
|
/* Free the entry because it isn't valid */
|
||||||
drm_cleanup_buf_error(dev, entry);
|
drm_cleanup_buf_error(dev, entry);
|
||||||
|
@ -37,7 +37,6 @@
|
|||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD$");
|
||||||
|
|
||||||
#include <dev/drm2/drmP.h>
|
#include <dev/drm2/drmP.h>
|
||||||
#include <linux/slab.h>
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the DMA data.
|
* Initialize the DMA data.
|
||||||
@ -90,17 +89,18 @@ void drm_dma_takedown(struct drm_device *dev)
|
|||||||
drm_pci_free(dev, dma->bufs[i].seglist[j]);
|
drm_pci_free(dev, dma->bufs[i].seglist[j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
kfree(dma->bufs[i].seglist);
|
free(dma->bufs[i].seglist, DRM_MEM_SEGS);
|
||||||
}
|
}
|
||||||
if (dma->bufs[i].buf_count) {
|
if (dma->bufs[i].buf_count) {
|
||||||
for (j = 0; j < dma->bufs[i].buf_count; j++) {
|
for (j = 0; j < dma->bufs[i].buf_count; j++) {
|
||||||
kfree(dma->bufs[i].buflist[j].dev_private);
|
free(dma->bufs[i].buflist[j].dev_private,
|
||||||
|
DRM_MEM_BUFS);
|
||||||
}
|
}
|
||||||
kfree(dma->bufs[i].buflist);
|
free(dma->bufs[i].buflist, DRM_MEM_BUFS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kfree(dma->buflist);
|
free(dma->buflist, DRM_MEM_BUFS);
|
||||||
free(dma->pagelist, DRM_MEM_PAGES);
|
free(dma->pagelist, DRM_MEM_PAGES);
|
||||||
free(dev->dma, DRM_MEM_DRIVER);
|
free(dev->dma, DRM_MEM_DRIVER);
|
||||||
dev->dma = NULL;
|
dev->dma = NULL;
|
||||||
|
@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
|
|
||||||
#include <sys/sysent.h>
|
#include <sys/sysent.h>
|
||||||
|
|
||||||
|
#include <linux/slab.h>
|
||||||
#include <dev/drm2/drmP.h>
|
#include <dev/drm2/drmP.h>
|
||||||
#include <dev/drm2/drm_core.h>
|
#include <dev/drm2/drm_core.h>
|
||||||
#include <dev/drm2/drm_global.h>
|
#include <dev/drm2/drm_global.h>
|
||||||
@ -211,7 +212,7 @@ int drm_lastclose(struct drm_device * dev)
|
|||||||
if (entry->bound)
|
if (entry->bound)
|
||||||
drm_unbind_agp(entry->memory);
|
drm_unbind_agp(entry->memory);
|
||||||
drm_free_agp(entry->memory, entry->pages);
|
drm_free_agp(entry->memory, entry->pages);
|
||||||
free(entry, DRM_MEM_AGPLISTS);
|
kfree(entry);
|
||||||
}
|
}
|
||||||
INIT_LIST_HEAD(&dev->agp->memory);
|
INIT_LIST_HEAD(&dev->agp->memory);
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ MALLOC_DEFINE(DRM_MEM_MAGIC, "drm_magic", "DRM MAGIC Data Structures");
|
|||||||
MALLOC_DEFINE(DRM_MEM_MINOR, "drm_minor", "DRM MINOR Data Structures");
|
MALLOC_DEFINE(DRM_MEM_MINOR, "drm_minor", "DRM MINOR Data Structures");
|
||||||
MALLOC_DEFINE(DRM_MEM_IOCTLS, "drm_ioctls", "DRM IOCTL Data Structures");
|
MALLOC_DEFINE(DRM_MEM_IOCTLS, "drm_ioctls", "DRM IOCTL Data Structures");
|
||||||
MALLOC_DEFINE(DRM_MEM_MAPS, "drm_maps", "DRM MAP Data Structures");
|
MALLOC_DEFINE(DRM_MEM_MAPS, "drm_maps", "DRM MAP Data Structures");
|
||||||
|
MALLOC_DEFINE(DRM_MEM_BUFS, "drm_bufs", "DRM BUFFER Data Structures");
|
||||||
MALLOC_DEFINE(DRM_MEM_SEGS, "drm_segs", "DRM SEGMENTS Data Structures");
|
MALLOC_DEFINE(DRM_MEM_SEGS, "drm_segs", "DRM SEGMENTS Data Structures");
|
||||||
MALLOC_DEFINE(DRM_MEM_PAGES, "drm_pages", "DRM PAGES Data Structures");
|
MALLOC_DEFINE(DRM_MEM_PAGES, "drm_pages", "DRM PAGES Data Structures");
|
||||||
MALLOC_DEFINE(DRM_MEM_FILES, "drm_files", "DRM FILE Data Structures");
|
MALLOC_DEFINE(DRM_MEM_FILES, "drm_files", "DRM FILE Data Structures");
|
||||||
@ -23,7 +24,6 @@ MALLOC_DEFINE(DRM_MEM_QUEUES, "drm_queues", "DRM QUEUE Data Structures");
|
|||||||
MALLOC_DEFINE(DRM_MEM_CMDS, "drm_cmds", "DRM COMMAND Data Structures");
|
MALLOC_DEFINE(DRM_MEM_CMDS, "drm_cmds", "DRM COMMAND Data Structures");
|
||||||
MALLOC_DEFINE(DRM_MEM_MAPPINGS, "drm_mapping", "DRM MAPPING Data Structures");
|
MALLOC_DEFINE(DRM_MEM_MAPPINGS, "drm_mapping", "DRM MAPPING Data Structures");
|
||||||
MALLOC_DEFINE(DRM_MEM_BUFLISTS, "drm_buflists", "DRM BUFLISTS Data Structures");
|
MALLOC_DEFINE(DRM_MEM_BUFLISTS, "drm_buflists", "DRM BUFLISTS Data Structures");
|
||||||
MALLOC_DEFINE(DRM_MEM_AGPLISTS, "drm_agplists", "DRM AGPLISTS Data Structures");
|
|
||||||
MALLOC_DEFINE(DRM_MEM_CTXBITMAP, "drm_ctxbitmap",
|
MALLOC_DEFINE(DRM_MEM_CTXBITMAP, "drm_ctxbitmap",
|
||||||
"DRM CTXBITMAP Data Structures");
|
"DRM CTXBITMAP Data Structures");
|
||||||
MALLOC_DEFINE(DRM_MEM_SGLISTS, "drm_sglists", "DRM SGLISTS Data Structures");
|
MALLOC_DEFINE(DRM_MEM_SGLISTS, "drm_sglists", "DRM SGLISTS Data Structures");
|
||||||
@ -495,4 +495,5 @@ MODULE_VERSION(drmn, 1);
|
|||||||
MODULE_DEPEND(drmn, agp, 1, 1, 1);
|
MODULE_DEPEND(drmn, agp, 1, 1, 1);
|
||||||
MODULE_DEPEND(drmn, pci, 1, 1, 1);
|
MODULE_DEPEND(drmn, pci, 1, 1, 1);
|
||||||
MODULE_DEPEND(drmn, mem, 1, 1, 1);
|
MODULE_DEPEND(drmn, mem, 1, 1, 1);
|
||||||
|
MODULE_DEPEND(drmn, linuxkpi, 1, 1, 1);
|
||||||
MODULE_DEPEND(drmn, iicbus, 1, 1, 1);
|
MODULE_DEPEND(drmn, iicbus, 1, 1, 1);
|
||||||
|
@ -544,6 +544,7 @@ MALLOC_DECLARE(DRM_MEM_MAGIC);
|
|||||||
MALLOC_DECLARE(DRM_MEM_MINOR);
|
MALLOC_DECLARE(DRM_MEM_MINOR);
|
||||||
MALLOC_DECLARE(DRM_MEM_IOCTLS);
|
MALLOC_DECLARE(DRM_MEM_IOCTLS);
|
||||||
MALLOC_DECLARE(DRM_MEM_MAPS);
|
MALLOC_DECLARE(DRM_MEM_MAPS);
|
||||||
|
MALLOC_DECLARE(DRM_MEM_BUFS);
|
||||||
MALLOC_DECLARE(DRM_MEM_SEGS);
|
MALLOC_DECLARE(DRM_MEM_SEGS);
|
||||||
MALLOC_DECLARE(DRM_MEM_PAGES);
|
MALLOC_DECLARE(DRM_MEM_PAGES);
|
||||||
MALLOC_DECLARE(DRM_MEM_FILES);
|
MALLOC_DECLARE(DRM_MEM_FILES);
|
||||||
@ -551,7 +552,6 @@ MALLOC_DECLARE(DRM_MEM_QUEUES);
|
|||||||
MALLOC_DECLARE(DRM_MEM_CMDS);
|
MALLOC_DECLARE(DRM_MEM_CMDS);
|
||||||
MALLOC_DECLARE(DRM_MEM_MAPPINGS);
|
MALLOC_DECLARE(DRM_MEM_MAPPINGS);
|
||||||
MALLOC_DECLARE(DRM_MEM_BUFLISTS);
|
MALLOC_DECLARE(DRM_MEM_BUFLISTS);
|
||||||
MALLOC_DECLARE(DRM_MEM_AGPLISTS);
|
|
||||||
MALLOC_DECLARE(DRM_MEM_CTXBITMAP);
|
MALLOC_DECLARE(DRM_MEM_CTXBITMAP);
|
||||||
MALLOC_DECLARE(DRM_MEM_SGLISTS);
|
MALLOC_DECLARE(DRM_MEM_SGLISTS);
|
||||||
MALLOC_DECLARE(DRM_MEM_MM);
|
MALLOC_DECLARE(DRM_MEM_MM);
|
||||||
|
@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
|
|
||||||
#include <dev/drm2/drmP.h>
|
#include <dev/drm2/drmP.h>
|
||||||
#include <dev/drm2/drm_core.h>
|
#include <dev/drm2/drm_core.h>
|
||||||
|
#include <linux/slab.h>
|
||||||
|
|
||||||
#ifdef DRM_DEBUG_DEFAULT_ON
|
#ifdef DRM_DEBUG_DEFAULT_ON
|
||||||
unsigned int drm_debug = (DRM_DEBUGBITS_DEBUG | DRM_DEBUGBITS_KMS |
|
unsigned int drm_debug = (DRM_DEBUGBITS_DEBUG | DRM_DEBUGBITS_KMS |
|
||||||
@ -315,7 +316,7 @@ void drm_cancel_fill_in_dev(struct drm_device *dev)
|
|||||||
DRM_MTRR_WC);
|
DRM_MTRR_WC);
|
||||||
DRM_DEBUG("mtrr_del=%d\n", retval);
|
DRM_DEBUG("mtrr_del=%d\n", retval);
|
||||||
}
|
}
|
||||||
free(dev->agp, DRM_MEM_AGPLISTS);
|
kfree(dev->agp);
|
||||||
dev->agp = NULL;
|
dev->agp = NULL;
|
||||||
|
|
||||||
drm_ht_remove(&dev->map_hash);
|
drm_ht_remove(&dev->map_hash);
|
||||||
@ -467,7 +468,7 @@ void drm_put_dev(struct drm_device *dev)
|
|||||||
drm_sysctl_cleanup(dev);
|
drm_sysctl_cleanup(dev);
|
||||||
|
|
||||||
if (drm_core_has_AGP(dev) && dev->agp) {
|
if (drm_core_has_AGP(dev) && dev->agp) {
|
||||||
free(dev->agp, DRM_MEM_AGPLISTS);
|
kfree(dev->agp);
|
||||||
dev->agp = NULL;
|
dev->agp = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3081,7 +3081,7 @@ nfsrv_openctrl(struct nfsrv_descript *nd, vnode_t vp,
|
|||||||
new_deleg->ls_stateid.other[2] = delegstateidp->other[2]
|
new_deleg->ls_stateid.other[2] = delegstateidp->other[2]
|
||||||
= nfsrv_nextstateindex(clp);
|
= nfsrv_nextstateindex(clp);
|
||||||
if (writedeleg && !NFSVNO_EXRDONLY(exp) &&
|
if (writedeleg && !NFSVNO_EXRDONLY(exp) &&
|
||||||
(nfsrv_writedelegifpos && !readonly) &&
|
(nfsrv_writedelegifpos || !readonly) &&
|
||||||
(new_stp->ls_flags & NFSLCK_WANTRDELEG) == 0) {
|
(new_stp->ls_flags & NFSLCK_WANTRDELEG) == 0) {
|
||||||
new_deleg->ls_flags = (NFSLCK_DELEGWRITE |
|
new_deleg->ls_flags = (NFSLCK_DELEGWRITE |
|
||||||
NFSLCK_READACCESS | NFSLCK_WRITEACCESS);
|
NFSLCK_READACCESS | NFSLCK_WRITEACCESS);
|
||||||
@ -3153,7 +3153,7 @@ nfsrv_openctrl(struct nfsrv_descript *nd, vnode_t vp,
|
|||||||
delegstateidp->other[2]
|
delegstateidp->other[2]
|
||||||
= nfsrv_nextstateindex(clp);
|
= nfsrv_nextstateindex(clp);
|
||||||
if (writedeleg && !NFSVNO_EXRDONLY(exp) &&
|
if (writedeleg && !NFSVNO_EXRDONLY(exp) &&
|
||||||
(nfsrv_writedelegifpos && !readonly) &&
|
(nfsrv_writedelegifpos || !readonly) &&
|
||||||
((nd->nd_flag & ND_NFSV41) == 0 ||
|
((nd->nd_flag & ND_NFSV41) == 0 ||
|
||||||
(new_stp->ls_flags & NFSLCK_WANTRDELEG) ==
|
(new_stp->ls_flags & NFSLCK_WANTRDELEG) ==
|
||||||
0)) {
|
0)) {
|
||||||
|
@ -69,7 +69,6 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <sys/signalvar.h>
|
#include <sys/signalvar.h>
|
||||||
#include <sys/kdb.h>
|
#include <sys/kdb.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/seq.h>
|
|
||||||
#include <sys/sx.h>
|
#include <sys/sx.h>
|
||||||
#include <sys/syscallsubr.h>
|
#include <sys/syscallsubr.h>
|
||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
@ -4075,13 +4074,6 @@ invfo_sendfile(struct file *fp, int sockfd, struct uio *hdr_uio,
|
|||||||
return (EINVAL);
|
return (EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
fd_modified(struct filedesc *fdp, int fd, uint32_t seq)
|
|
||||||
{
|
|
||||||
|
|
||||||
return (!seq_consistent(fd_seq(fdp->fd_files, fd), seq));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*-------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -722,14 +722,6 @@ vpanic(const char *fmt, va_list ap)
|
|||||||
|
|
||||||
spinlock_enter();
|
spinlock_enter();
|
||||||
|
|
||||||
#if 0
|
|
||||||
/***** DEBUGGING DRM *****/
|
|
||||||
|
|
||||||
doadump(0);
|
|
||||||
EVENTHANDLER_INVOKE(shutdown_final, RB_NOSYNC);
|
|
||||||
|
|
||||||
/************************/
|
|
||||||
#endif
|
|
||||||
#ifdef SMP
|
#ifdef SMP
|
||||||
/*
|
/*
|
||||||
* stop_cpus_hard(other_cpus) should prevent multiple CPUs from
|
* stop_cpus_hard(other_cpus) should prevent multiple CPUs from
|
||||||
|
@ -48,6 +48,8 @@ SRCS = \
|
|||||||
ati_pcigart.c
|
ati_pcigart.c
|
||||||
#ttm_page_alloc_dma.c
|
#ttm_page_alloc_dma.c
|
||||||
|
|
||||||
|
CFLAGS+= -I${.CURDIR}/../../../compat/linuxkpi/common/include
|
||||||
|
|
||||||
.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64"
|
.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64"
|
||||||
SRCS += drm_ioc32.c
|
SRCS += drm_ioc32.c
|
||||||
.endif
|
.endif
|
||||||
|
@ -41,11 +41,6 @@ SYSINCS+= stat.h
|
|||||||
SRCS+= futimens.c utimensat.c
|
SRCS+= futimens.c utimensat.c
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
.if !exists(/usr/include/capsicum_helpers.h)
|
|
||||||
.PATH: ${.CURDIR}/../../lib/libcapsicum/
|
|
||||||
INCS+= capsicum_helpers.h
|
|
||||||
.endif
|
|
||||||
|
|
||||||
.if empty(SRCS)
|
.if empty(SRCS)
|
||||||
SRCS= dummy.c
|
SRCS= dummy.c
|
||||||
.endif
|
.endif
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $FreeBSD$
|
# $FreeBSD$
|
||||||
|
|
||||||
cldr /home/bapt/unicode/cldr/30.0.3
|
cldr ~/unicode/cldr/30.0.3
|
||||||
unidata /home/bapt/unicode/UNIDATA/9.0.0
|
unidata ~/unicode/UNIDATA/9.0.0
|
||||||
|
@ -52,9 +52,6 @@ _POSIX_V6_LPBIG_OFFBIG_CFLAGS, _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
|
|||||||
_POSIX_V6_LPBIG_OFFBIG_LDFLAGS, _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
|
_POSIX_V6_LPBIG_OFFBIG_LDFLAGS, _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
|
||||||
_POSIX_V6_LPBIG_OFFBIG_LIBS, _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
|
_POSIX_V6_LPBIG_OFFBIG_LIBS, _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
|
||||||
_POSIX_V6_WIDTH_RESTRICTED_ENVS, _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS
|
_POSIX_V6_WIDTH_RESTRICTED_ENVS, _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS
|
||||||
DARWIN_USER_DIR, _CS_DARWIN_USER_DIR
|
|
||||||
DARWIN_USER_TEMP_DIR, _CS_DARWIN_USER_TEMP_DIR
|
|
||||||
DARWIN_USER_CACHE_DIR, _CS_DARWIN_USER_CACHE_DIR
|
|
||||||
%%
|
%%
|
||||||
int
|
int
|
||||||
find_confstr(const char *name, int *key)
|
find_confstr(const char *name, int *key)
|
||||||
|
@ -187,3 +187,4 @@ do_pathconf(const char *name, int key, const char *path)
|
|||||||
else
|
else
|
||||||
printf("%ld\n", value);
|
printf("%ld\n", value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,9 +9,6 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#ifdef APPLE_GETCONF_UNDERSCORE
|
|
||||||
#include <alloca.h>
|
|
||||||
#endif /* APPLE_GETCONF_UNDERSCORE */
|
|
||||||
|
|
||||||
#include "getconf.h"
|
#include "getconf.h"
|
||||||
|
|
||||||
@ -23,11 +20,11 @@ static const struct map *in_word_set(const char *str);
|
|||||||
%}
|
%}
|
||||||
struct map { const char *name; intmax_t value; int valid; };
|
struct map { const char *name; intmax_t value; int valid; };
|
||||||
%%
|
%%
|
||||||
|
_POSIX_CLOCKRES_MIN, _POSIX_CLOCKRES_MIN
|
||||||
_POSIX_AIO_LISTIO_MAX, _POSIX_AIO_LISTIO_MAX
|
_POSIX_AIO_LISTIO_MAX, _POSIX_AIO_LISTIO_MAX
|
||||||
_POSIX_AIO_MAX, _POSIX_AIO_MAX
|
_POSIX_AIO_MAX, _POSIX_AIO_MAX
|
||||||
_POSIX_ARG_MAX, _POSIX_ARG_MAX
|
_POSIX_ARG_MAX, _POSIX_ARG_MAX
|
||||||
_POSIX_CHILD_MAX, _POSIX_CHILD_MAX
|
_POSIX_CHILD_MAX, _POSIX_CHILD_MAX
|
||||||
_POSIX_CLOCKRES_MIN, _POSIX_CLOCKRES_MIN
|
|
||||||
_POSIX_DELAYTIMER_MAX, _POSIX_DELAYTIMER_MAX
|
_POSIX_DELAYTIMER_MAX, _POSIX_DELAYTIMER_MAX
|
||||||
_POSIX_HOST_NAME_MAX, _POSIX_HOST_NAME_MAX
|
_POSIX_HOST_NAME_MAX, _POSIX_HOST_NAME_MAX
|
||||||
_POSIX_LINK_MAX, _POSIX_LINK_MAX
|
_POSIX_LINK_MAX, _POSIX_LINK_MAX
|
||||||
@ -67,7 +64,7 @@ _POSIX2_BC_SCALE_MAX, _POSIX2_BC_SCALE_MAX
|
|||||||
_POSIX2_BC_STRING_MAX, _POSIX2_BC_STRING_MAX
|
_POSIX2_BC_STRING_MAX, _POSIX2_BC_STRING_MAX
|
||||||
_POSIX2_CHARCLASS_NAME_MAX, _POSIX2_CHARCLASS_NAME_MAX
|
_POSIX2_CHARCLASS_NAME_MAX, _POSIX2_CHARCLASS_NAME_MAX
|
||||||
_POSIX2_COLL_WEIGHTS_MAX, _POSIX2_COLL_WEIGHTS_MAX
|
_POSIX2_COLL_WEIGHTS_MAX, _POSIX2_COLL_WEIGHTS_MAX
|
||||||
_POSIX2_EXPR_NEST_MAX, _POSIX2_EXPR_NEST_MAX
|
_POSIX2_EXPR_NEXT_MAX, _POSIX2_EXPR_NEST_MAX
|
||||||
_POSIX2_LINE_MAX, _POSIX2_LINE_MAX
|
_POSIX2_LINE_MAX, _POSIX2_LINE_MAX
|
||||||
_POSIX2_RE_DUP_MAX, _POSIX2_RE_DUP_MAX
|
_POSIX2_RE_DUP_MAX, _POSIX2_RE_DUP_MAX
|
||||||
_XOPEN_IOV_MAX, _XOPEN_IOV_MAX
|
_XOPEN_IOV_MAX, _XOPEN_IOV_MAX
|
||||||
@ -108,9 +105,6 @@ int
|
|||||||
find_limit(const char *name, intmax_t *value)
|
find_limit(const char *name, intmax_t *value)
|
||||||
{
|
{
|
||||||
const struct map *rv;
|
const struct map *rv;
|
||||||
#ifdef APPLE_GETCONF_UNDERSCORE
|
|
||||||
char *alt;
|
|
||||||
#endif /* APPLE_GETCONF_UNDERSCORE */
|
|
||||||
|
|
||||||
rv = in_word_set(name);
|
rv = in_word_set(name);
|
||||||
if (rv != NULL) {
|
if (rv != NULL) {
|
||||||
@ -120,23 +114,5 @@ find_limit(const char *name, intmax_t *value)
|
|||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#ifdef APPLE_GETCONF_UNDERSCORE
|
|
||||||
if(*name == '_')
|
|
||||||
alt = (char *)name + 1;
|
|
||||||
else {
|
|
||||||
if((alt = (char *)alloca(strlen(name) + 2)) == NULL)
|
|
||||||
return 0;
|
|
||||||
*alt = '_';
|
|
||||||
strcpy(alt + 1, name);
|
|
||||||
}
|
|
||||||
rv = in_word_set(alt);
|
|
||||||
if (rv != NULL) {
|
|
||||||
if (rv->valid) {
|
|
||||||
*value = rv->value;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
#endif /* APPLE_GETCONF_UNDERSCORE */
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -9,9 +9,6 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#ifdef APPLE_GETCONF_UNDERSCORE
|
|
||||||
#include <alloca.h>
|
|
||||||
#endif /* APPLE_GETCONF_UNDERSCORE */
|
|
||||||
|
|
||||||
#include "getconf.h"
|
#include "getconf.h"
|
||||||
|
|
||||||
@ -23,10 +20,17 @@ static const struct map *in_word_set(const char *str);
|
|||||||
%}
|
%}
|
||||||
struct map { const char *name; int key; int valid; };
|
struct map { const char *name; int key; int valid; };
|
||||||
%%
|
%%
|
||||||
|
ACL_EXTENDED, _PC_ACL_EXTENDED
|
||||||
|
ACL_NFS4, _PC_ACL_NFS4
|
||||||
|
ACL_PATH_MAX, _PC_ACL_PATH_MAX
|
||||||
|
CAP_PRESENT, _PC_CAP_PRESENT
|
||||||
FILESIZEBITS, _PC_FILESIZEBITS
|
FILESIZEBITS, _PC_FILESIZEBITS
|
||||||
|
INF_PRESENT, _PC_INF_PRESENT
|
||||||
LINK_MAX, _PC_LINK_MAX
|
LINK_MAX, _PC_LINK_MAX
|
||||||
|
MAC_PRESENT, _PC_MAC_PRESENT
|
||||||
MAX_CANON, _PC_MAX_CANON
|
MAX_CANON, _PC_MAX_CANON
|
||||||
MAX_INPUT, _PC_MAX_INPUT
|
MAX_INPUT, _PC_MAX_INPUT
|
||||||
|
MIN_HOLE_SIZE, _PC_MIN_HOLE_SIZE
|
||||||
NAME_MAX, _PC_NAME_MAX
|
NAME_MAX, _PC_NAME_MAX
|
||||||
PATH_MAX, _PC_PATH_MAX
|
PATH_MAX, _PC_PATH_MAX
|
||||||
PIPE_BUF, _PC_PIPE_BUF
|
PIPE_BUF, _PC_PIPE_BUF
|
||||||
@ -35,28 +39,24 @@ POSIX_REC_INCR_XFER_SIZE, _PC_REC_INCR_XFER_SIZE
|
|||||||
POSIX_REC_MAX_XFER_SIZE, _PC_REC_MAX_XFER_SIZE
|
POSIX_REC_MAX_XFER_SIZE, _PC_REC_MAX_XFER_SIZE
|
||||||
POSIX_REC_MIN_XFER_SIZE, _PC_REC_MIN_XFER_SIZE
|
POSIX_REC_MIN_XFER_SIZE, _PC_REC_MIN_XFER_SIZE
|
||||||
POSIX_REC_XFER_ALIGN, _PC_REC_XFER_ALIGN
|
POSIX_REC_XFER_ALIGN, _PC_REC_XFER_ALIGN
|
||||||
POSIX2_SYMLINKS, _PC_2_SYMLINKS
|
|
||||||
SYMLINK_MAX, _PC_SYMLINK_MAX
|
SYMLINK_MAX, _PC_SYMLINK_MAX
|
||||||
TRUSTEDBSD_ACL_EXTENDED, _PC_ACL_EXTENDED
|
TRUSTEDBSD_ACL_EXTENDED, _PC_ACL_EXTENDED
|
||||||
|
TRUSTEDBSD_ACL_NFS4, _PC_ACL_NFS4
|
||||||
TRUSTEDBSD_ACL_PATH_MAX, _PC_ACL_PATH_MAX
|
TRUSTEDBSD_ACL_PATH_MAX, _PC_ACL_PATH_MAX
|
||||||
TRUSTEDBSD_CAP_PRESENT, _PC_CAP_PRESENT
|
TRUSTEDBSD_CAP_PRESENT, _PC_CAP_PRESENT
|
||||||
TRUSTEDBSD_INF_PRESENT, _PC_INF_PRESENT
|
TRUSTEDBSD_INF_PRESENT, _PC_INF_PRESENT
|
||||||
TRUSTEDBSD_MAC_PRESENT, _PC_MAC_PRESENT
|
TRUSTEDBSD_MAC_PRESENT, _PC_MAC_PRESENT
|
||||||
_POSIX_ASYNC_IO, _PC_ASYNC_IO
|
|
||||||
_POSIX_CHOWN_RESTRICTED, _PC_CHOWN_RESTRICTED
|
_POSIX_CHOWN_RESTRICTED, _PC_CHOWN_RESTRICTED
|
||||||
_POSIX_NO_TRUNC, _PC_NO_TRUNC
|
_POSIX_NO_TRUNC, _PC_NO_TRUNC
|
||||||
_POSIX_PATH_MAX, _PC_PATH_MAX
|
_POSIX_VDISABLE, _PC_VDISABLE
|
||||||
|
_POSIX_ASYNC_IO, _PC_ASYNC_IO
|
||||||
_POSIX_PRIO_IO, _PC_PRIO_IO
|
_POSIX_PRIO_IO, _PC_PRIO_IO
|
||||||
_POSIX_SYNC_IO, _PC_SYNC_IO
|
_POSIX_SYNC_IO, _PC_SYNC_IO
|
||||||
_POSIX_VDISABLE, _PC_VDISABLE
|
|
||||||
%%
|
%%
|
||||||
int
|
int
|
||||||
find_pathconf(const char *name, int *key)
|
find_pathconf(const char *name, int *key)
|
||||||
{
|
{
|
||||||
const struct map *rv;
|
const struct map *rv;
|
||||||
#ifdef APPLE_GETCONF_UNDERSCORE
|
|
||||||
char *alt;
|
|
||||||
#endif /* APPLE_GETCONF_UNDERSCORE */
|
|
||||||
|
|
||||||
rv = in_word_set(name);
|
rv = in_word_set(name);
|
||||||
if (rv != NULL) {
|
if (rv != NULL) {
|
||||||
@ -66,23 +66,5 @@ find_pathconf(const char *name, int *key)
|
|||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#ifdef APPLE_GETCONF_UNDERSCORE
|
|
||||||
if(*name == '_')
|
|
||||||
alt = (char *)name + 1;
|
|
||||||
else {
|
|
||||||
if((alt = (char *)alloca(strlen(name) + 2)) == NULL)
|
|
||||||
return 0;
|
|
||||||
*alt = '_';
|
|
||||||
strcpy(alt + 1, name);
|
|
||||||
}
|
|
||||||
rv = in_word_set(alt);
|
|
||||||
if (rv != NULL) {
|
|
||||||
if (rv->valid) {
|
|
||||||
*key = rv->key;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
#endif /* APPLE_GETCONF_UNDERSCORE */
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -30,14 +30,11 @@ static const struct map *in_word_set(const char *str);
|
|||||||
* be updated. (We cheat here and define the supported environments
|
* be updated. (We cheat here and define the supported environments
|
||||||
* statically.)
|
* statically.)
|
||||||
*/
|
*/
|
||||||
#if defined(__alpha__) || defined(__sparc64__)
|
#if defined(__sparc64__) || defined(__amd64__)
|
||||||
#define have_LP64_OFF64 NULL
|
#define have_LP64_OFF64 NULL
|
||||||
#elif defined(__APPLE__)
|
|
||||||
#define have_LP64_OFF64 NULL
|
|
||||||
#define have_LPBIG_OFFBIG NULL
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__i386__) || defined(__powerpc__) || defined(__x86_64__)
|
#if defined(__i386__) || defined(__powerpc__)
|
||||||
#define have_ILP32_OFFBIG NULL
|
#define have_ILP32_OFFBIG NULL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -47,11 +44,11 @@ struct map { const char *name; const char *alt_path; int valid; };
|
|||||||
POSIX_V6_ILP32_OFF32, notdef
|
POSIX_V6_ILP32_OFF32, notdef
|
||||||
POSIX_V6_ILP32_OFFBIG, have_ILP32_OFFBIG
|
POSIX_V6_ILP32_OFFBIG, have_ILP32_OFFBIG
|
||||||
POSIX_V6_LP64_OFF64, have_LP64_OFF64
|
POSIX_V6_LP64_OFF64, have_LP64_OFF64
|
||||||
POSIX_V6_LPBIG_OFFBIG, have_LPBIG_OFFBIG
|
POSIX_V6_LPBIG_OFFBIG, notdef
|
||||||
_POSIX_V6_ILP32_OFF32, notdef
|
_POSIX_V6_ILP32_OFF32, notdef
|
||||||
_POSIX_V6_ILP32_OFFBIG, have_ILP32_OFFBIG
|
_POSIX_V6_ILP32_OFFBIG, have_ILP32_OFFBIG
|
||||||
_POSIX_V6_LP64_OFF64, have_LP64_OFF64
|
_POSIX_V6_LP64_OFF64, have_LP64_OFF64
|
||||||
_POSIX_V6_LPBIG_OFFBIG, have_LPBIG_OFFBIG
|
_POSIX_V6_LPBIG_OFFBIG, notdef
|
||||||
%%
|
%%
|
||||||
int
|
int
|
||||||
find_progenv(const char *name, const char **alt_path)
|
find_progenv(const char *name, const char **alt_path)
|
||||||
|
@ -9,9 +9,6 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#ifdef APPLE_GETCONF_UNDERSCORE
|
|
||||||
#include <alloca.h>
|
|
||||||
#endif /* APPLE_GETCONF_UNDERSCORE */
|
|
||||||
|
|
||||||
#include "getconf.h"
|
#include "getconf.h"
|
||||||
|
|
||||||
@ -73,16 +70,9 @@ _POSIX2_C_VERSION, _SC_2_C_VERSION
|
|||||||
_POSIX2_FORT_DEV, _SC_2_FORT_DEV
|
_POSIX2_FORT_DEV, _SC_2_FORT_DEV
|
||||||
_POSIX2_FORT_RUN, _SC_2_FORT_RUN
|
_POSIX2_FORT_RUN, _SC_2_FORT_RUN
|
||||||
_POSIX2_LOCALEDEF, _SC_2_LOCALEDEF
|
_POSIX2_LOCALEDEF, _SC_2_LOCALEDEF
|
||||||
_POSIX2_PBS, _SC_PBS
|
|
||||||
_POSIX2_PBS_ACCOUNTING, _SC_PBS_ACCOUNTING
|
|
||||||
_POSIX2_PBS_CHECKPOINT, _SC_PBS_CHECKPOINT
|
|
||||||
_POSIX2_PBS_LOCATE, _SC_PBS_LOCATE
|
|
||||||
_POSIX2_PBS_MESSAGE, _SC_PBS_MESSAGE
|
|
||||||
_POSIX2_PBS_TRACK, _SC_PBS_TRACK
|
|
||||||
_POSIX2_SW_DEV, _SC_2_SW_DEV
|
_POSIX2_SW_DEV, _SC_2_SW_DEV
|
||||||
_POSIX2_UPE, _SC_2_UPE
|
_POSIX2_UPE, _SC_2_UPE
|
||||||
_POSIX2_VERSION, _SC_2_VERSION
|
_POSIX2_VERSION, _SC_2_VERSION
|
||||||
_POSIX_ADVISORY_INFO, _SC_ADVISORY_INFO
|
|
||||||
_POSIX_ASYNCHRONOUS_IO, _SC_ASYNCHRONOUS_IO
|
_POSIX_ASYNCHRONOUS_IO, _SC_ASYNCHRONOUS_IO
|
||||||
_POSIX_BARRIERS, _SC_BARRIERS
|
_POSIX_BARRIERS, _SC_BARRIERS
|
||||||
_POSIX_CLOCK_SELECTION, _SC_CLOCK_SELECTION
|
_POSIX_CLOCK_SELECTION, _SC_CLOCK_SELECTION
|
||||||
@ -99,7 +89,6 @@ _POSIX_MESSAGE_PASSING, _SC_MESSAGE_PASSING
|
|||||||
_POSIX_MONOTONIC_CLOCK, _SC_MONOTONIC_CLOCK
|
_POSIX_MONOTONIC_CLOCK, _SC_MONOTONIC_CLOCK
|
||||||
_POSIX_PRIORITIZED_IO, _SC_PRIORITIZED_IO
|
_POSIX_PRIORITIZED_IO, _SC_PRIORITIZED_IO
|
||||||
_POSIX_PRIORITY_SCHEDULING, _SC_PRIORITY_SCHEDULING
|
_POSIX_PRIORITY_SCHEDULING, _SC_PRIORITY_SCHEDULING
|
||||||
_POSIX_RAW_SOCKETS, _SC_RAW_SOCKETS
|
|
||||||
_POSIX_READER_WRITER_LOCKS, _SC_READER_WRITER_LOCKS
|
_POSIX_READER_WRITER_LOCKS, _SC_READER_WRITER_LOCKS
|
||||||
_POSIX_REALTIME_SIGNALS, _SC_REALTIME_SIGNALS
|
_POSIX_REALTIME_SIGNALS, _SC_REALTIME_SIGNALS
|
||||||
_POSIX_REGEXP, _SC_REGEXP
|
_POSIX_REGEXP, _SC_REGEXP
|
||||||
@ -110,7 +99,6 @@ _POSIX_SHELL, _SC_SHELL
|
|||||||
_POSIX_SPAWN, _SC_SPAWN
|
_POSIX_SPAWN, _SC_SPAWN
|
||||||
_POSIX_SPIN_LOCKS, _SC_SPIN_LOCKS
|
_POSIX_SPIN_LOCKS, _SC_SPIN_LOCKS
|
||||||
_POSIX_SPORADIC_SERVER, _SC_SPORADIC_SERVER
|
_POSIX_SPORADIC_SERVER, _SC_SPORADIC_SERVER
|
||||||
_POSIX_SS_REPL_MAX, _SC_SS_REPL_MAX
|
|
||||||
_POSIX_SYNCHRONIZED_IO, _SC_SYNCHRONIZED_IO
|
_POSIX_SYNCHRONIZED_IO, _SC_SYNCHRONIZED_IO
|
||||||
_POSIX_THREADS, _SC_THREADS
|
_POSIX_THREADS, _SC_THREADS
|
||||||
_POSIX_THREAD_ATTR_STACKADDR, _SC_THREAD_ATTR_STACKADDR
|
_POSIX_THREAD_ATTR_STACKADDR, _SC_THREAD_ATTR_STACKADDR
|
||||||
@ -123,28 +111,23 @@ _POSIX_THREAD_PROCESS_SHARED, _SC_THREAD_PROCESS_SHARED
|
|||||||
_POSIX_THREAD_SAFE_FUNCTIONS, _SC_THREAD_SAFE_FUNCTIONS
|
_POSIX_THREAD_SAFE_FUNCTIONS, _SC_THREAD_SAFE_FUNCTIONS
|
||||||
_POSIX_THREAD_SPORADIC_SERVER, _SC_THREAD_SPORADIC_SERVER
|
_POSIX_THREAD_SPORADIC_SERVER, _SC_THREAD_SPORADIC_SERVER
|
||||||
_POSIX_TIMEOUTS, _SC_TIMEOUTS
|
_POSIX_TIMEOUTS, _SC_TIMEOUTS
|
||||||
_POSIX_TIMERS, _SC_TIMERS
|
|
||||||
_POSIX_TRACE, _SC_TRACE
|
_POSIX_TRACE, _SC_TRACE
|
||||||
_POSIX_TRACE_EVENT_FILTER, _SC_TRACE_EVENT_FILTER
|
_POSIX_TRACE_EVENT_FILTER, _SC_TRACE_EVENT_FILTER
|
||||||
_POSIX_TRACE_EVENT_NAME_MAX, _SC_TRACE_EVENT_NAME_MAX
|
|
||||||
_POSIX_TRACE_INHERIT, _SC_TRACE_INHERIT
|
_POSIX_TRACE_INHERIT, _SC_TRACE_INHERIT
|
||||||
_POSIX_TRACE_LOG, _SC_TRACE_LOG
|
_POSIX_TRACE_LOG, _SC_TRACE_LOG
|
||||||
_POSIX_TRACE_NAME_MAX, _SC_TRACE_NAME_MAX
|
_POSIX_TIMERS, _SC_TIMERS
|
||||||
_POSIX_TRACE_SYS_MAX, _SC_TRACE_SYS_MAX
|
|
||||||
_POSIX_TRACE_USER_EVENT_MAX, _SC_TRACE_USER_EVENT_MAX
|
|
||||||
_POSIX_TYPED_MEMORY_OBJECTS, _SC_TYPED_MEMORY_OBJECTS
|
_POSIX_TYPED_MEMORY_OBJECTS, _SC_TYPED_MEMORY_OBJECTS
|
||||||
|
_POSIX_VERSION, _SC_VERSION
|
||||||
_POSIX_V6_ILP32_OFF32, _SC_V6_ILP32_OFF32
|
_POSIX_V6_ILP32_OFF32, _SC_V6_ILP32_OFF32
|
||||||
_POSIX_V6_ILP32_OFFBIG, _SC_V6_ILP32_OFFBIG
|
_POSIX_V6_ILP32_OFFBIG, _SC_V6_ILP32_OFFBIG
|
||||||
_POSIX_V6_LP64_OFF64, _SC_V6_LP64_OFF64
|
_POSIX_V6_LP64_OFF64, _SC_V6_LP64_OFF64
|
||||||
_POSIX_V6_LPBIG_OFFBIG, _SC_V6_LPBIG_OFFBIG
|
_POSIX_V6_LPBIG_OFFBIG, _SC_V6_LPBIG_OFFBIG
|
||||||
_POSIX_VERSION, _SC_VERSION
|
|
||||||
_XOPEN_CRYPT, _SC_XOPEN_CRYPT
|
_XOPEN_CRYPT, _SC_XOPEN_CRYPT
|
||||||
_XOPEN_ENH_I18N, _SC_XOPEN_ENH_I18N
|
_XOPEN_ENH_I18N, _SC_XOPEN_ENH_I18N
|
||||||
_XOPEN_LEGACY, _SC_XOPEN_LEGACY
|
_XOPEN_LEGACY, _SC_XOPEN_LEGACY
|
||||||
_XOPEN_REALTIME, _SC_XOPEN_REALTIME
|
_XOPEN_REALTIME, _SC_XOPEN_REALTIME
|
||||||
_XOPEN_REALTIME_THREADS, _SC_XOPEN_REALTIME_THREADS
|
_XOPEN_REALTIME_THREADS, _SC_XOPEN_REALTIME_THREADS
|
||||||
_XOPEN_SHM, _SC_XOPEN_SHM
|
_XOPEN_SHM, _SC_XOPEN_SHM
|
||||||
_XOPEN_STREAMS, _SC_XOPEN_STREAMS
|
|
||||||
_XOPEN_UNIX, _SC_XOPEN_UNIX
|
_XOPEN_UNIX, _SC_XOPEN_UNIX
|
||||||
_XOPEN_VERSION, _SC_XOPEN_VERSION
|
_XOPEN_VERSION, _SC_XOPEN_VERSION
|
||||||
_XOPEN_XCU_VERSION, _SC_XCU_VERSION
|
_XOPEN_XCU_VERSION, _SC_XCU_VERSION
|
||||||
@ -153,9 +136,6 @@ int
|
|||||||
find_sysconf(const char *name, int *key)
|
find_sysconf(const char *name, int *key)
|
||||||
{
|
{
|
||||||
const struct map *rv;
|
const struct map *rv;
|
||||||
#ifdef APPLE_GETCONF_UNDERSCORE
|
|
||||||
char *alt;
|
|
||||||
#endif /* APPLE_GETCONF_UNDERSCORE */
|
|
||||||
|
|
||||||
rv = in_word_set(name);
|
rv = in_word_set(name);
|
||||||
if (rv != NULL) {
|
if (rv != NULL) {
|
||||||
@ -165,23 +145,5 @@ find_sysconf(const char *name, int *key)
|
|||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#ifdef APPLE_GETCONF_UNDERSCORE
|
|
||||||
if(*name == '_')
|
|
||||||
alt = (char *)name + 1;
|
|
||||||
else {
|
|
||||||
if((alt = (char *)alloca(strlen(name) + 2)) == NULL)
|
|
||||||
return 0;
|
|
||||||
*alt = '_';
|
|
||||||
strcpy(alt + 1, name);
|
|
||||||
}
|
|
||||||
rv = in_word_set(alt);
|
|
||||||
if (rv != NULL) {
|
|
||||||
if (rv->valid) {
|
|
||||||
*key = rv->key;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
#endif /* APPLE_GETCONF_UNDERSCORE */
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -167,7 +167,7 @@ init_runtime_env(struct configuration *config)
|
|||||||
retval = calloc(1, sizeof(*retval));
|
retval = calloc(1, sizeof(*retval));
|
||||||
assert(retval != NULL);
|
assert(retval != NULL);
|
||||||
|
|
||||||
retval->sockfd = socket(PF_LOCAL, SOCK_STREAM|SOCK_NONBLOCK, 0);
|
retval->sockfd = socket(PF_LOCAL, SOCK_STREAM, 0);
|
||||||
|
|
||||||
if (config->force_unlink == 1)
|
if (config->force_unlink == 1)
|
||||||
unlink(config->socket_path);
|
unlink(config->socket_path);
|
||||||
@ -198,6 +198,7 @@ init_runtime_env(struct configuration *config)
|
|||||||
*/
|
*/
|
||||||
chmod(config->socket_path, config->socket_mode);
|
chmod(config->socket_path, config->socket_mode);
|
||||||
listen(retval->sockfd, -1);
|
listen(retval->sockfd, -1);
|
||||||
|
fcntl(retval->sockfd, F_SETFL, O_NONBLOCK);
|
||||||
|
|
||||||
retval->queue = kqueue();
|
retval->queue = kqueue();
|
||||||
assert(retval->queue != -1);
|
assert(retval->queue != -1);
|
||||||
|
@ -189,7 +189,7 @@ open_nscd_connection__(struct nscd_connection_params const *params)
|
|||||||
TRACE_IN(open_nscd_connection);
|
TRACE_IN(open_nscd_connection);
|
||||||
assert(params != NULL);
|
assert(params != NULL);
|
||||||
|
|
||||||
client_socket = socket(PF_LOCAL, SOCK_STREAM|SOCK_NONBLOCK, 0);
|
client_socket = socket(PF_LOCAL, SOCK_STREAM, 0);
|
||||||
client_address.sun_family = PF_LOCAL;
|
client_address.sun_family = PF_LOCAL;
|
||||||
strlcpy(client_address.sun_path, params->socket_path,
|
strlcpy(client_address.sun_path, params->socket_path,
|
||||||
sizeof(client_address.sun_path));
|
sizeof(client_address.sun_path));
|
||||||
@ -203,6 +203,7 @@ open_nscd_connection__(struct nscd_connection_params const *params)
|
|||||||
TRACE_OUT(open_nscd_connection);
|
TRACE_OUT(open_nscd_connection);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
fcntl(client_socket, F_SETFL, O_NONBLOCK);
|
||||||
|
|
||||||
retval = calloc(1, sizeof(*retval));
|
retval = calloc(1, sizeof(*retval));
|
||||||
assert(retval != NULL);
|
assert(retval != NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user