- case 'w':
- len = atoi(commands+1);
- if (len <= 0)
- len = 1;
- if (bufsize < len) {
- buf = realloc(buf, len + ALIGN);
- if (buf == NULL) {
- save_errno = errno;
- perror("allocating buf for write\n");
- exit(save_errno);
- }
- bufsize = len;
- buf_align = (char *)((long)(buf + ALIGN) &
- ~ALIGN);
- strncpy(buf_align, msg, bufsize);
- }
- while (len > 0) {
- rc = write(fd, buf_align, len);
- if (rc == -1) {
- save_errno = errno;
- perror("write");
- exit(save_errno);
- }
- if (rc < len)
- fprintf(stderr, "short write: %u/%u\n",
- rc, len);
- len -= rc;
- }
- break;
+ case 'V':
+ len = get_flags(commands + 1, &flags);
+ commands += len;
+ fd = llapi_create_volatile(fname, flags);
+ if (fd < 0) {
+ perror("llapi_create_volatile");
+ exit(fd);
+ }
+ break;
+ case 'w':
+ len = atoi(commands+1);
+ if (len <= 0)
+ len = 1;
+ if (bufsize < len) {
+ buf = realloc(buf, len + ALIGN_LEN);
+ if (buf == NULL) {
+ save_errno = errno;
+ perror("allocating buf for write\n");
+ exit(save_errno);
+ }
+ bufsize = len;
+ buf_align = (char *)((long)(buf + ALIGN_LEN) &
+ ~ALIGN_LEN);
+ strncpy(buf_align, msg, bufsize);
+ }
+ while (len > 0) {
+ rc = write(fd, buf_align, len);
+ if (rc == -1) {
+ save_errno = errno;
+ perror("write");
+ exit(save_errno);
+ }
+ if (rc < len)
+ fprintf(stderr, "short write: %u/%u\n",
+ rc, len);
+ len -= rc;
+ }
+ break;