?? file_lock.h
字號(hào):
/* * $Id: file_lock.h,v 1.2 2003/10/20 18:59:57 tomcollins Exp $ * Copyright (C) 2000-2003 Inter7 Internet Technologies, Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * functions straight out of Richard Steven's * "Advanced Programming in the UNIX Environment" * * Translated into bytes by Eric Peters (eric@peters.org) * August 19, 2000 */#ifndef VPOPMAIL_FILELOCK_H#define VPOPMAIL_FILELOCK_H#define MAX_TRY_RLOCK 10#define MAX_TRY_WLOCK 15intlock_reg(int fd, int cmd, int type, off_t offset, int whence, off_t len);#define read_lock(fd, offset, whence, len) \ lock_reg(fd, F_SETLK, F_RDLCK, offset, whence, len)#define readw_lock(fd, offset, whence, len) \ lock_reg(fd, F_SETLKW, F_RDLCK, offset, whence, len)#define write_lock(fd, offset, whence, len) \ lock_reg(fd, F_SETLK, F_WRLCK, offset, whence, len)#define writew_lock(fd, offset, whence, len) \ lock_reg(fd, F_SETLKW, F_WRLCK, offset, whence, len)#define unlock_lock(fd, offset, whence, len) \ lock_reg(fd, F_SETLK, F_UNLCK, offset, whence, len)pid_tlock_test(int fd, int type, off_t offset, int whence, off_t len);#define is_readlock(fd, offset, whence, len) \ lock_test(fd, F_RDLCK, offset, whence, len)#define is_writelock(fd, offset, whence, len) \ lock_test(fd, F_WRLCK, offset, whence, len)int get_read_lock( FILE *fs );int get_write_lock( FILE *fs );#endif
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -