extended code to advanced input functionality
This commit is contained in:
parent
bb32f2abc5
commit
58cf91a06d
23
OS/C/theory/sync/semaextraposts.c
Normal file
23
OS/C/theory/sync/semaextraposts.c
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <pthread.h>
|
||||||
|
#include <semaphore.h>
|
||||||
|
#include <sys/semaphore.h>
|
||||||
|
|
||||||
|
sem_t my_semaphore;
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
sem_init(&my_semaphore, 0, 5);
|
||||||
|
int sem_val;
|
||||||
|
sem_getvalue(&my_semaphore, &sem_val);
|
||||||
|
printf("Semaphore value after extra posts: %d\n", sem_val);
|
||||||
|
|
||||||
|
sem_post(&my_semaphore);
|
||||||
|
sem_post(&my_semaphore);
|
||||||
|
sem_post(&my_semaphore);
|
||||||
|
|
||||||
|
sem_getvalue(&my_semaphore, &sem_val);
|
||||||
|
printf("Semaphore value after extra posts: %d\n", sem_val);
|
||||||
|
|
||||||
|
sem_destroy(&my_semaphore);
|
||||||
|
return 0;
|
||||||
|
}
|
0
OS/bash/progcheck/hello/apple
Normal file
0
OS/bash/progcheck/hello/apple
Normal file
0
OS/bash/progcheck/hello/banana
Normal file
0
OS/bash/progcheck/hello/banana
Normal file
0
OS/bash/progcheck/hello/chicken
Normal file
0
OS/bash/progcheck/hello/chicken
Normal file
0
OS/bash/progcheck/hello/hello
Normal file
0
OS/bash/progcheck/hello/hello
Normal file
0
OS/bash/progcheck/hello/orange
Normal file
0
OS/bash/progcheck/hello/orange
Normal file
0
OS/bash/progcheck/hello/world
Normal file
0
OS/bash/progcheck/hello/world
Normal file
17
OS/bash/progcheck/solenhanced.sh
Executable file
17
OS/bash/progcheck/solenhanced.sh
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
folder="$@"
|
||||||
|
|
||||||
|
for j in $folder
|
||||||
|
do
|
||||||
|
echo "Checking $j"
|
||||||
|
|
||||||
|
x=`find "$j" -type f -iname "[!aeiou]*"`
|
||||||
|
|
||||||
|
for i in $x
|
||||||
|
do
|
||||||
|
echo "$i"
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
|
# This script takes a folder name as a CLI argument and then lists all files that do not begin with a vowel (in filename)
|
0
OS/bash/progcheck/test/apple
Normal file
0
OS/bash/progcheck/test/apple
Normal file
0
OS/bash/progcheck/test/banana
Normal file
0
OS/bash/progcheck/test/banana
Normal file
0
OS/bash/progcheck/test/chicken
Normal file
0
OS/bash/progcheck/test/chicken
Normal file
0
OS/bash/progcheck/test/hello
Normal file
0
OS/bash/progcheck/test/hello
Normal file
0
OS/bash/progcheck/test/orange
Normal file
0
OS/bash/progcheck/test/orange
Normal file
0
OS/bash/progcheck/test/world
Normal file
0
OS/bash/progcheck/test/world
Normal file
Loading…
x
Reference in New Issue
Block a user