Ant-Veil

Caspar Blog

每一次实验和大作业都是学习的过程

| Comments

这次学会了结构体的对齐,记录锁和 QT 的基本操作。顺便强烈推荐使用 qt-creator 进行开发。

当然还碰到个囧事,一个文件用 r 方式打开了,然后想往上面加写锁,加了半天就是报“错误的文件描述符”,郁闷之下 man 了下 fcntl 的内容,顿悟:

EBADF fd is not an open file descriptor, or the command was F_SETLK or F_SETLKW
and the file descriptor open mode doesn't match with the type of lock
requested.

其实本来想写很多的,但是因为这个东西做的时间太长了,又忘了随手记,就只能写出这么多了……

Comments