Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
relibc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
coolreader18
relibc
Commits
90f3be63
Unverified
Commit
90f3be63
authored
Dec 05, 2020
by
Noah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle TCSETSW and TCSETSF in ioctl
parent
07ec3b65
Pipeline
#8772
failed with stages
in 9 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
src/header/sys_ioctl/redox.rs
src/header/sys_ioctl/redox.rs
+6
-1
No files found.
src/header/sys_ioctl/redox.rs
View file @
90f3be63
...
...
@@ -12,6 +12,8 @@ pub const FIONBIO: c_ulong = 0x5421;
pub
const
TCGETS
:
c_ulong
=
0x5401
;
pub
const
TCSETS
:
c_ulong
=
0x5402
;
pub
const
TCSETSW
:
c_ulong
=
0x5403
;
pub
const
TCSETSF
:
c_ulong
=
0x5404
;
pub
const
TCSBRK
:
c_ulong
=
0x5409
;
pub
const
TCXONC
:
c_ulong
=
0x540A
;
...
...
@@ -24,6 +26,8 @@ pub const TIOCSPGRP: c_ulong = 0x5410;
pub
const
TIOCGWINSZ
:
c_ulong
=
0x5413
;
pub
const
TIOCSWINSZ
:
c_ulong
=
0x5414
;
// TODO: some of the structs passed as T have padding bytes, so casting to a byte slice is UB
fn
dup_read
<
T
>
(
fd
:
c_int
,
name
:
&
str
,
t
:
&
mut
T
)
->
syscall
::
Result
<
usize
>
{
let
dup
=
syscall
::
dup
(
fd
as
usize
,
name
.as_bytes
())
?
;
...
...
@@ -79,7 +83,8 @@ pub unsafe extern "C" fn ioctl(fd: c_int, request: c_ulong, out: *mut c_void) ->
0
}
}
TCSETS
=>
{
// TODO: give these different behaviors
TCSETS
..=
TCSETSF
=>
{
let
termios
=
&*
(
out
as
*
const
termios
::
termios
);
if
e
(
dup_write
(
fd
,
"termios"
,
termios
))
==
!
0
{
-
1
...
...
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