MCPcopy Create free account
hub / github.com/dmtcp/dmtcp / processFileConnection

Method processFileConnection

src/plugin/ipc/file/fileconnlist.cpp:686–730  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

684}
685
686void
687FileConnList::processFileConnection(int fd,
688 const char *path,
689 int flags,
690 mode_t mode)
691{
692 Connection *c = NULL;
693
694 string device;
695
696 if (path == NULL) {
697 device = jalib::Filesystem::GetDeviceName(fd);
698 } else {
699 device = jalib::Filesystem::ResolveSymlink(path);
700 if (device == "") {
701 device = path;
702 }
703 }
704
705 struct stat statbuf;
706 JASSERT(fstat(fd, &statbuf) == 0);
707
708 if (strstr(device.c_str(), "infiniband/uverbs") ||
709 strstr(device.c_str(), "uverbs-event")) {
710 return;
711 }
712
713 path = device.c_str();
714 if (S_ISREG(statbuf.st_mode) || S_ISCHR(statbuf.st_mode) ||
715 S_ISDIR(statbuf.st_mode) || S_ISBLK(statbuf.st_mode)) {
716 int type = FileConnection::FILE_REGULAR;
717 if (dmtcp_is_bq_file && dmtcp_is_bq_file(path)) {
718 // Resource manager related
719 type = FileConnection::FILE_BATCH_QUEUE;
720 }
721 c = new FileConnection(path, flags, mode, type);
722 } else if (S_ISFIFO(statbuf.st_mode)) {
723 // FIFO
724 c = new FifoConnection(path, flags, mode);
725 } else {
726 JASSERT(false) (path).Text("Unimplemented file type.");
727 }
728
729 add(fd, c);
730}

Callers 2

processReopenMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected