Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F47960502
kill_ls.c
hselasky (Hans Petter Selasky)
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
•
hselasky
Sep 8 2022, 11:32 AM
2022-09-08 11:32:21 (UTC+0)
Size
736 B
Referenced Files
None
Subscribers
None
kill_ls.c
View Options
#include
<stdio.h>
#include
<stdint.h>
#include
<sys/stat.h>
#include
<err.h>
#define MAX (1 << 14)
static
void
hps_bad
(
void
**
v
,
uint32_t
n
)
{
uint32_t
i
;
for
(
i
=
0
;
i
<
n
/
2
;
i
++
)
v
[
i
]
=
(
void
*
)(
uintptr_t
)(
n
/
2
-
i
);
v
[
n
/
2
]
=
(
void
*
)(
uintptr_t
)(
n
/
2
+
1
);
for
(
i
=
n
/
2
+
1
;
i
<
n
;
i
++
)
v
[
i
]
=
(
void
*
)(
uintptr_t
)(
n
+
n
/
2
+
1
-
i
);
}
static
void
*
number
[
MAX
];
int
main
(
int
argc
,
char
**
argv
)
{
hps_bad
(
number
,
MAX
);
char
path
[
256
];
if
(
mkdir
(
"/tmp/kill_ls"
,
0777
)
!=
0
)
errx
(
0
,
"FAILURE"
);
for
(
unsigned
x
=
0
;
x
!=
MAX
;
x
++
)
{
snprintf
(
path
,
sizeof
(
path
),
"/tmp/kill_ls/%09zd"
,
(
uintptr_t
)
number
[
x
]);
printf
(
"%s
\n
"
,
path
);
if
(
mkdir
(
path
,
0777
)
!=
0
)
errx
(
0
,
"FAILURE"
);
}
return
(
0
);
}
File Metadata
Details
Attached
Mime Type
text/x-c
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5113194
Default Alt Text
kill_ls.c (736 B)
Attached To
Mode
D36493: libc: Implement bsort(3) bitonic sorting algorithm.
Attached
Detach File
Event Timeline
Log In to Comment