#include <errno.h>
#include <fcntl.h>
#include <getopt.h>
-#include <linux/const.h>
#include <linux/logger.h>
#include <pthread.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
setlinebuf(stdout);
fd = open(device, O_WRONLY);
- if (ac >= 2) {
- }
-
- if (ac == 3) {
- }
-
if (test_mask & BIT(0)) {
vec[0].iov_base = &prio;
vec[0].iov_len = 1;
ioctl(fd, LOGGER_SET_TAG, &struct_tag);
if (test_mask & BIT(2)) {
-
- write(fd, "The Foo From STDIO\n", 19);
+ int count;
+ count = write(fd, "The Foo From STDIO\n", 19);
+ if (count != 19)
+ printf("count != 19\n");
write(fd, "LINE #1\nLINE #2", 15);
write(fd, " CONTINUED\nONCE", 15);
return 1;
for (int i = 0; i < 8000; i++)
- msg[i] = ' ' + (i % 96);
+ msg[i] = '!' + (i % 95);
msg[7999] = '\n';
write(fd, msg, 8000);
+
+ for (int i = 0; (test_mask & BIT(4)) && i < 40; i++)
+ write(fd, msg, 8000);
+
+ for (int i = 0; (test_mask & BIT(5)) && i < 8000; i++)
+ write(fd, &msg[i], 1);
+
+ free(msg);
+ msg = NULL;
}
- if (test_mask & BIT(4)) {
+ if (test_mask & BIT(6)) {
child = fork();
if (child < 0) {
return -1;
wait(&s);
}
- if (test_mask & BIT(5)) {
+ if (test_mask & BIT(7)) {
s = pthread_create(&tid, NULL, &tstart, &fd);
if (s != 0)
handle_error_en(s, "pthread_create");