Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
35ca26ac
Commit
35ca26ac
authored
Mar 31, 2011
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libgo/syscalls: Use _C_long as the type of the select bits array.
From-SVN: r171799
parent
c454d74a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
libgo/syscalls/sysfile_posix.go
+7
-5
No files found.
libgo/syscalls/sysfile_posix.go
View file @
35ca26ac
...
@@ -181,20 +181,22 @@ func Gettimeofday(tv *Timeval) (errno int) {
...
@@ -181,20 +181,22 @@ func Gettimeofday(tv *Timeval) (errno int) {
return
;
return
;
}
}
const
nfdbits
=
unsafe
.
Sizeof
(
_C_long
)
*
8
type
FdSet_t
struct
{
type
FdSet_t
struct
{
Fds_bits
[(
FD_SETSIZE
+
63
)
/
64
]
int64
;
Fds_bits
[(
FD_SETSIZE
+
nfdbits
-
1
)
/
nfdbits
]
_C_long
}
}
func
FDSet
(
fd
int
,
set
*
FdSet_t
)
{
func
FDSet
(
fd
int
,
set
*
FdSet_t
)
{
set
.
Fds_bits
[
fd
/
64
]
|=
(
1
<<
(
uint
)(
fd
%
64
))
set
.
Fds_bits
[
fd
/
nfdbits
]
|=
(
1
<<
(
uint
)(
fd
%
nfdbits
))
}
}
func
FDClr
(
fd
int
,
set
*
FdSet_t
)
{
func
FDClr
(
fd
int
,
set
*
FdSet_t
)
{
set
.
Fds_bits
[
fd
/
64
]
&=
^
(
1
<<
(
uint
)(
fd
%
64
))
set
.
Fds_bits
[
fd
/
nfdbits
]
&^=
(
1
<<
(
uint
)(
fd
%
nfdbits
))
}
}
func
FDIsSet
(
fd
int
,
set
*
FdSet_t
)
bool
{
func
FDIsSet
(
fd
int
,
set
*
FdSet_t
)
bool
{
if
set
.
Fds_bits
[
fd
/
64
]
&
(
1
<<
(
uint
)(
fd
%
64
))
!=
0
{
if
set
.
Fds_bits
[
fd
/
nfdbits
]
&
(
1
<<
(
uint
)(
fd
%
nfdbits
))
!=
0
{
return
true
return
true
}
else
{
}
else
{
return
false
return
false
...
@@ -202,7 +204,7 @@ func FDIsSet(fd int, set *FdSet_t) bool {
...
@@ -202,7 +204,7 @@ func FDIsSet(fd int, set *FdSet_t) bool {
}
}
func
FDZero
(
set
*
FdSet_t
)
{
func
FDZero
(
set
*
FdSet_t
)
{
for
i
:=
0
;
i
<
((
FD_SETSIZE
+
63
)
/
64
);
i
++
{
for
i
:=
range
set
.
Fds_bits
{
set
.
Fds_bits
[
i
]
=
0
set
.
Fds_bits
[
i
]
=
0
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment