🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: cn.bbs.comp.program
1 messages
1 total messages Started by ��ɵ Mon, 15 Dec 1997 00:00
Re: unix�����ļ�
#2541
Author: ��ɵ
Date: Mon, 15 Dec 1997 00:00
29 lines
1096 bytes
�� �� than (�Ϻ���) �Ĵ������ᵽ: ��
: It is different between SYSV and BSD, try flock() or lockf().
: man flock
: or
: man lockf
: to get help, good luck!

        �ҵ�����Solaris2.5.2�£����æ��һ�������

#include <stdio.h>
#include <sys/file.h>

main()
{
   FILE *fp;

   fp=fopen("file_to_lock", "r");
   flock("file_to_lock", LOCK_EX);
   printf("file is being lock, to unlock , press <enter>\n");
   getchar();
   flock("file_to_lock", LOCK_UN);
   fclose(fp);
   return;
}


--
�� ��Դ:���人���ƻƺ�վ s1000e.whnet.edu.cn��[FROM: 202.96.128.92]
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads