ALT Linux Bugzilla
– Attachment 7882 Details for
Bug 35731
Неожиданное поведение при попытке залочить файл на samba
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
share_lock.c
share_lock.c (text/x-csrc), 791 bytes, created by
Aleksei Nikiforov
on 2018-12-06 12:51:05 MSK
(
hide
)
Description:
share_lock.c
Filename:
MIME Type:
Creator:
Aleksei Nikiforov
Created:
2018-12-06 12:51:05 MSK
Size:
791 bytes
patch
obsolete
>#include <stdio.h> >#include <sys/stat.h> >#include <fcntl.h> >#include <errno.h> >#include <unistd.h> >#include <string.h> > >int main(int argc, char **argv) >{ > int fd; > int e; > struct flock aflock; > > if (argc != 2) > { > fprintf(stderr, "USAGE: %s filename\n", argv[0]); > return -1; > } > > fd = open(argv[1], O_RDWR); > if (fd < 0) > { > e = errno; > fprintf(stderr, "open error: %d, %s\n", e, strerror(e)); > return -1; > } > > aflock.l_type = F_WRLCK; > aflock.l_whence = SEEK_SET; > aflock.l_start = 0; > aflock.l_len = 0; > > if (fcntl(fd, F_SETLK, &aflock) < 0) > { > e = errno; > > fprintf(stderr, "fcntl error: %d, %s\n", e, strerror(e)); > > (void) close(fd); > return -1; > } > > printf("File locked successfully.\nPress any key to exit...\n"); > > (void) getchar(); > > (void) close(fd); > > return 0; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 35731
:
7881
| 7882 |
7890
|
7907