/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "lint.h"
#include <fcntl.h>
#include <unistd.h>
#include <sys/port_impl.h>
#include <errno.h>
#include <stdlib.h>
#include <libc.h>
/*
* The second argument of _portfs(PORT_CREATE, 0,,,) represents the version
* number of the event ports framework. The version number is required to
* identify possible changes/extensions of the port_event_t structure. If an
* extension is required the port_create() function will be mapped to a second
* library create function like port_create_v1(PORT_CREATE, VERSION,,,)
* VERSION will be a number > 0.
* As long as such an extension is not required the second argument will be
* set to 0 and no check will be done in the kernel interface.
*/
int
{
rval_t r;
return (r.r_val1);
}
int
{
rval_t r;
return (r.r_val1);
}
int
{
rval_t r;
if (to)
else
return (r.r_val1);
}
int
{
rval_t r;
return (-1);
}
if (r.r_val1 == -1) {
/* global error, errno is already set */
return (-1);
}
return (-1);
}
return (r.r_val2);
}
int
{
rval_t r;
return (r.r_val1);
}
int
{
rval_t r;
NULL);
return (r.r_val1);
}
/*
* _port_dispatch() will block if there are not resources available to
* satisfy the request.
*/
int
void *user)
{
rval_t r;
if (flags & PORT_SHARE_EVENT)
else
return (r.r_val1);
}
int
{
rval_t r;
if (nent <= PORT_MAX_LIST) {
return (r.r_val1);
}
/* use chunks of max PORT_MAX_LIST elements per syscall */
nevents = 0;
else
if (r.r_val2 == -1) {
/* global error, return last no of events submitted */
if (nevents)
return (nevents);
return (-1);
}
}
/* list submitted */
return (nevents);
}
int
{
rval_t r;
NULL);
return (r.r_val1);
}