Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
felixmoebius
libc
Commits
a79a73f8
Commit
a79a73f8
authored
6 years ago
by
Mackenzie Clark
Browse files
Options
Downloads
Patches
Plain Diff
add some socket functions and a SOCKET type
parent
c1ae35da
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/windows/mod.rs
+20
-0
20 additions, 0 deletions
src/windows/mod.rs
with
20 additions
and
0 deletions
src/windows/mod.rs
+
20
−
0
View file @
a79a73f8
...
@@ -50,6 +50,8 @@ pub type ino_t = u16;
...
@@ -50,6 +50,8 @@ pub type ino_t = u16;
pub
enum
timezone
{}
pub
enum
timezone
{}
pub
type
time64_t
=
i64
;
pub
type
time64_t
=
i64
;
pub
type
SOCKET
=
uintptr_t
;
s!
{
s!
{
// note this is the struct called stat64 in Windows. Not stat, nor stati64.
// note this is the struct called stat64 in Windows. Not stat, nor stati64.
pub
struct
stat
{
pub
struct
stat
{
...
@@ -93,6 +95,11 @@ s! {
...
@@ -93,6 +95,11 @@ s! {
pub
tv_sec
:
time_t
,
pub
tv_sec
:
time_t
,
pub
tv_nsec
:
c_long
,
pub
tv_nsec
:
c_long
,
}
}
pub
struct
sockaddr
{
pub
sa_family
:
c_ushort
,
pub
sa_data
:
[
c_char
;
14
],
}
}
}
pub
const
INT_MIN
:
c_int
=
-
2147483648
;
pub
const
INT_MIN
:
c_int
=
-
2147483648
;
...
@@ -301,6 +308,19 @@ extern {
...
@@ -301,6 +308,19 @@ extern {
pub
fn
signal
(
signum
:
c_int
,
handler
:
sighandler_t
)
->
sighandler_t
;
pub
fn
signal
(
signum
:
c_int
,
handler
:
sighandler_t
)
->
sighandler_t
;
pub
fn
raise
(
signum
:
c_int
)
->
c_int
;
pub
fn
raise
(
signum
:
c_int
)
->
c_int
;
// winsock functions
pub
fn
listen
(
s
:
SOCKET
,
backlog
:
c_int
)
->
c_int
;
pub
fn
accept
(
s
:
SOCKET
,
addr
:
*
mut
sockaddr
,
addrlen
:
*
mut
c_int
)
->
SOCKET
;
pub
fn
bind
(
s
:
SOCKET
,
name
:
*
mut
sockaddr
,
namelen
:
c_int
)
->
c_int
;
pub
fn
connect
(
s
:
SOCKET
,
name
:
*
mut
sockaddr
,
namelen
:
c_int
)
->
c_int
;
pub
fn
getpeername
(
s
:
SOCKET
,
name
:
*
mut
sockaddr
,
nameln
:
*
mut
c_int
)
->
c_int
;
pub
fn
getsockname
(
s
:
SOCKET
,
name
:
*
mut
sockaddr
,
nameln
:
*
mut
c_int
)
->
c_int
;
pub
fn
getsockopt
(
s
:
SOCKET
,
level
:
c_int
,
optname
:
c_int
,
optval
:
*
mut
c_char
,
optlen
:
*
mut
c_int
)
->
c_int
;
pub
fn
recvfrom
(
s
:
SOCKET
,
buf
:
*
mut
c_char
,
len
:
c_int
,
flags
:
c_int
,
from
:
*
mut
sockaddr
,
fromlen
:
*
mut
c_int
)
->
c_int
;
pub
fn
sendto
(
s
:
SOCKET
,
buf
:
*
mut
c_char
,
len
:
c_int
,
flags
:
c_int
,
to
:
*
mut
sockaddr
,
tolen
:
c_int
)
->
c_int
;
pub
fn
setsockopt
(
s
:
SOCKET
,
level
:
c_int
,
optname
:
c_int
,
optval
:
*
mut
c_char
,
optlen
:
c_int
)
->
c_int
;
pub
fn
socket
(
af
:
c_int
,
socket_type
:
c_int
,
protocol
:
c_int
)
->
SOCKET
;
#[link_name
=
"_chmod"
]
#[link_name
=
"_chmod"
]
pub
fn
chmod
(
path
:
*
const
c_char
,
mode
:
::
c_int
)
->
::
c_int
;
pub
fn
chmod
(
path
:
*
const
c_char
,
mode
:
::
c_int
)
->
::
c_int
;
#[link_name
=
"_wchmod"
]
#[link_name
=
"_wchmod"
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment