Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
GUYOT DOMINIQUE
paraload-ng
Commits
2bf683a9
Commit
2bf683a9
authored
Jan 22, 2020
by
dguyot
Browse files
Initial commit for parser
parent
f48bac81
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
parser.cpp
parser.cpp
+28
-0
No files found.
parser.cpp
0 → 100644
View file @
2bf683a9
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <inttypes.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string_view>
int
main
(
int
argc
,
char
**
argv
){
struct
stat
sfd
;
int
fd
;
size_t
size
;
char
*
mmfile
;
int
i
;
fd
=
open
(
argv
[
1
],
O_RDONLY
);
fstat
(
fd
,
&
sfd
);
size
=
sfd
.
st_size
;
mmfile
=
(
char
*
)
mmap
(
NULL
,
size
,
PROT_READ
,
MAP_PRIVATE
|
MAP_DENYWRITE
,
fd
,
0
);
close
(
fd
);
}
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