[so] [Tema5]Nelamuriri testul 2 Linux

ana-maria lepar amylepar at gmail.com
Thu Jun 11 23:15:46 EEST 2009


Salut,

Ms. Am rezolvat cu testul 1 [eu ieseam din client -1].
Acum la testul 2 cu verificarea api-ului folosit imi da failed, desi am in
cod  epoll_ctl, epoll_create, epoll_wait etc.

Testul 2 arata asa :
=================
nm ../server | grep epoll_ctl &&\
nm ../server | grep epoll_wait &&\
nm ../server | grep epoll_create &&\
nm ../server | grep io_setup &&\
nm ../server | grep io_submit &&\
nm ../server | grep eventfd

if [ $? -ne 0 ]
    then do_exit 1
    else do_exit 0
fi
==================

Iar mie cand rulez checkerul imi da :

==================
Started test 02...
         U epoll_ctl@@GLIBC_2.3.2
         U epoll_wait@@GLIBC_2.3.2
         U epoll_create@@GLIBC_2.3.2
-- FAILED --
=================

In cod functiile le-am folosit doar in server astfel  :

==================
  //pentru epoll:
        int epfd;
        struct epoll_event *events = (struct epoll_event*)
calloc(MAX_CLIENTS, sizeof(struct epoll_event));
        if (events == NULL) {
                perror (" eroare la alocare events \n");
                return -1;
        }

        struct epoll_event ev;

 //incep sa primesc clientii si sa le procesez cererile
        epfd = epoll_create(MAX_CLIENTS);
        if(epfd == -1)
        {
                perror("epoll_create\n");
                return -1;
        }
        ev.events = EPOLLIN | EPOLLERR | EPOLLHUP;
        ev.data.fd = listenfd;
        er = epoll_ctl(epfd, EPOLL_CTL_ADD, listenfd, &ev);
        if (er < 0)
        {
                perror("epoll_ctl, adding listenfd\n");
                exit(1);
        }


        //adaug eventfd la files descriptorii asociati
        ev.data.fd = evfd;
        ev.events = EPOLLIN;


        for( ; ; )
        {
                res = epoll_wait(epfd, events, MAX_CLIENTS, 0);
           .... diverse prelucrari
    }
=================================

Imi puteti spune ce gresesc aici?

Multumesc inca o data

Ana
332cc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cursuri.cs.pub.ro/pipermail/so/attachments/20090611/9206047c/attachment.htm>


More information about the so mailing list