aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/lookup.c
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2019-10-25 18:30:40 +0200
committerNeale Ranns <nranns@cisco.com>2019-10-28 09:07:14 +0000
commit1b1ccadc900deffd7b8e306ae8dce79a3115778c (patch)
treee5dcc9834a74b931eb91efb3b5625856ddbb2b48 /src/vnet/ip/lookup.c
parentdf0191ead2cf39611714b6603cdc5bdddc445b57 (diff)
vapi: switch to python3
Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I78aac39b697e29bb454e5e95855e79ea3122b4c3
Diffstat (limited to 'src/vnet/ip/lookup.c')
0 files changed, 0 insertions, 0 deletions
{ color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
# NOTE: win32 support is currently experimental, and not recommended
# for production use.


from __future__ import absolute_import, division, print_function, with_statement
import ctypes
import ctypes.wintypes

# See: http://msdn.microsoft.com/en-us/library/ms724935(VS.85).aspx
SetHandleInformation = ctypes.windll.kernel32.SetHandleInformation
SetHandleInformation.argtypes = (ctypes.wintypes.HANDLE, ctypes.wintypes.DWORD, ctypes.wintypes.DWORD)
SetHandleInformation.restype = ctypes.wintypes.BOOL

HANDLE_FLAG_INHERIT = 0x00000001


def set_close_exec(fd):
    success = SetHandleInformation(fd, HANDLE_FLAG_INHERIT, 0)
    if not success:
        raise ctypes.GetLastError()