corrected wrong use of O_CLOEXEC and FD_CLOEXEC in some files

This commit is contained in:
2018-10-22 03:46:19 +00:00
parent 54cd5401d5
commit ea85e91391
12 changed files with 257 additions and 179 deletions

View File

@ -1,3 +1,29 @@
/*
* $Id$
*
Copyright (c) 2006-2014 Chung, Hyung-Hwan. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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 DAMAGE.
*/
#ifndef _QSE_SI_NETLINK_H_
#define _QSE_SI_NETLINK_H_
@ -26,15 +52,6 @@ typedef int (*qse_nlenum_cb_t) (
extern "C" {
#endif
QSE_EXPORT int qse_nlenum (
int fd,
unsigned int seq,
int type,
int af,
qse_nlenum_cb_t cb,
void* ctx
);
QSE_EXPORT int qse_nlenum_route (
int link_af,
int addr_af,

View File

@ -62,43 +62,48 @@
typedef int qse_sck_len_t;
#endif
enum qse_shutsckhnd_how_t
enum qse_shut_sck_how_t
{
QSE_SHUTSCKHND_R = 0,
QSE_SHUTSCKHND_W = 1,
QSE_SHUTSCKHND_RW = 2
};
typedef enum qse_shutsckhnd_how_t qse_shutsckhnd_how_t;
typedef enum qse_shut_sck_how_t qse_shut_sck_how_t;
#if defined(__cplusplus)
extern "C" {
#endif
QSE_EXPORT int qse_isvalidsckhnd (
QSE_EXPORT int qse_is_sck_valid (
qse_sck_hnd_t handle
);
QSE_EXPORT void qse_closesckhnd (
QSE_EXPORT void qse_close_sck (
qse_sck_hnd_t handle
);
QSE_EXPORT void qse_shutsckhnd (
qse_sck_hnd_t handle,
qse_shutsckhnd_how_t how
QSE_EXPORT void qse_shut_sck (
qse_sck_hnd_t handle,
qse_shut_sck_how_t how
);
QSE_EXPORT int qse_setscknonblock (
QSE_EXPORT int qse_set_sck_nonblock (
qse_sck_hnd_t handle,
int enabled
);
QSE_EXPORT int qse_initsckconn (
QSE_EXPORT int qse_set_sck_cloexec (
qse_sck_hnd_t handle,
int enabled
);
QSE_EXPORT int qse_init_sck_conn (
qse_sck_hnd_t handle,
const qse_nwad_t* nwad
);
QSE_EXPORT int qse_finisckconn (
QSE_EXPORT int qse_fini_sck_conn (
qse_sck_hnd_t handle
);