I use fcntl in my codes to lock file and unlock to practice like mutex in windows... I start my app in linux manually, i got right result, with the app runs smoothly... but i was asked to make a bash script to start the app daily.... my script is
cd myapppaht
./myapp
however, i got [Bad file descriptor]
when it try to lock a file position...
is the crontab task practice not powerful as manual user root?
#define writew_lock(fd , offset , whence , len) lock_reg((fd) , F_SETLKW , F_WRLCK , (offset) , (whence) , (len))
#define un_lock(fd , offset , whence , len) lock_reg((fd) , F_SETLK , F_UNLCK , (offset) , (whence) , (len))