On some boundary value problems for second order functional differential equations